• Stars
    star
    1,518
  • Rank 30,867 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

make visualization in markdown. πŸ“ŠπŸ“ˆ

logo

Markvis

Make visualization in markdown.

NPM version NPM downloads Build Coverage donate FOSSA Status

Preview

Quick Start

Install

yarn add markvis --save
npm install markvis --save

Usage

const md = require('markdown-it')()
const vis = require('markvis')
const d3 = require('d3')  // in browser environment
const d3node = require('d3-node') // in node environment

md.use(vis).render(`
  your markdown content
`, {
  d3,    // in browser environment
  d3node // in node environment
})

there are Examples which in node environment.

Motivation

We often publish articles enriched with data, since data make them more convincing and easy to interpret. Hence, techniques that enable the embedding of visualization into texts are of great importance.

However, the most frequently used method now is to export charts as images, upload them into cloud, and then paste them into the editor. It is a tedious process from the perspective of a writer. Besides, image loading costs much more time than that of DOM elements, which leads to poor experience from the perspective of a reader.

API

There are many options you can config and below is some in common. But you'd better to config the options which related to chart style in chart options, such as markvis-bar, markvis-line, markvis-pie.

options

data
  • Type: Array

Data from file or web processed by d3 library.

d3
  • Type: Object

d3 library which used in browser environment.

d3node
  • Type: Function

d3-node constructor which used in node environment.

layout
  • Type: String

Name of chart layout. You can customize any chart layout you want.

render
  • Type: Function

Customized renderer to render a new layout you want.

container
  • Type: String
  • Default: <div id="container"><h2>Bar Chart</h2><div id="chart"></div></div>

DOM contained the visualization result.

selector
  • Type: String
  • Default: '#chart'

DOM selector in container.

style
  • Type: String
  • Default: ''

Chart style.

width
  • Type: Number
  • Default: 960

SVG width for chart.

height
  • Type: Number
  • Default: 500

SVG height for chart.

margin
  • Type: Object
  • Default: { top: 20, right: 20, bottom: 20, left: 20 }

Margin of the first wrapper in SVG, usually used to add axis.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

LICENSE

markvis Β© geekplux, Released under the MIT License.
Authored and maintained by geekplux with help from contributors (list).

geekplux.com Β· GitHub @geekplux Β· Twitter @geekplux

FOSSA Status

More Repositories

1

hexo-theme-typing

a pure and fresh Hexo theme. 🎹
CSS
280
star
2

cv_resume

A latex cv/resume template.
TeX
218
star
3

koa2-boilerplate

[Deprecated] Minimal koa v2 boilerplate. 🀣
JavaScript
193
star
4

share

Host some files I may want to share
90
star
5

timeline-sankey

A project to visualize time range series data using the Sankey diagram.
TypeScript
85
star
6

AR-AI-VIS-demo

a demo with AR, AI, Visualization
JavaScript
78
star
7

d3-force-webgl-integration-demo

Integrating WebGL and D3-force to improve performance. πŸ‘»
JavaScript
49
star
8

douban_read_download

Download your book reading records from douban to a CSV file.
Python
31
star
9

new_words

To generate a new word.
JavaScript
25
star
10

hexo-tag-video

the tag plugin of Hexo to insert a video
JavaScript
24
star
11

saber-theme-paper

A simple theme like read on a paper.
Vue
21
star
12

markdown-it-fence

fence customize plugin for markdown-it
JavaScript
20
star
13

wiki

GeekPlux's personal wiki
HTML
18
star
14

activities

Python
13
star
15

Basic-Visualization-in-Unity

Basic 2D visualization in Unity
C#
10
star
16

site

JavaScript
9
star
17

geekplux.github.io

[Deprecation][PREVIOUS] My Website
HTML
7
star
18

markdown-editor

Markdown editor by Vue.js
HTML
6
star
19

markvis-editor

markvis-editor
Vue
5
star
20

image-match

Compare different images pixel by pixel.
HTML
4
star
21

codewars

Programming need to practice, you know.
JavaScript
4
star
22

dotfiles

my dotfiles
Emacs Lisp
4
star
23

about

An About page for GeekPlux
JavaScript
3
star
24

geekplux

3
star
25

Icons-Redesign

Practice
2
star
26

contacts

simple contacts management
Vue
2
star
27

markvis-pie

Pie chart generator for markvis in browser and node.js.
JavaScript
2
star
28

markvis-line

Line chart generator for markvis in browser and node.js.
HTML
2
star
29

markvis-bar

Bar chart generator for markvis in browser and node.js.
HTML
2
star
30

d3-trial-bar

D3 trial bar chart
JavaScript
2
star
31

mini-harp

Mini Harp Static Server
CoffeeScript
1
star
32

eslint-config-geekplux

ESLint config for geekplux
JavaScript
1
star
33

sketch-learning

sketch-learning
1
star
34

screenshot-service

JavaScript
1
star
35

saber-plugin-seo

SEO plugin for [Saber.js](https://saberjs.org/).
JavaScript
1
star
36

Microscope

The Discover Meteor book's example app.
JavaScript
1
star
37

d3-experiment

Some experiment, test and evaluation for using d3.
JavaScript
1
star
38

d3-trial-line

D3 trial line chart
JavaScript
1
star
39

template-mini-vue

sao template for minimal Vue
JavaScript
1
star
40

mini-express

Mini Express
CoffeeScript
1
star
41

wechat-bot

a prototype of wechat bot.
TypeScript
1
star
42

ama

Ask me anything!
1
star
43

beyondcode-fm

TypeScript
1
star