Skip to content

📊 Re-usable, easy interface JavaScript chart library based on D3.js

License

Notifications You must be signed in to change notification settings

mpietrobo/billboard.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

billboard.js

v2.0 dev branch

Branch for next major release 2.0.

DO NOT use for production.

Installation

Directly from the github repository

# Run install command from shell
$ npm install git+https://github.com/naver/billboard.js.git#v2 --save

Main Goals

  • Move codebase to TypeScript
  • Restructure of file system & class architecture
  • Make smaller build & run faster
  • Do not break backward compatibility

Breaking Changes

Updates on private state variables

Reorganized selection and state variables. (Note: Even is accessible, do not use nor access private values)

  • All states are member of state prop.
  • All selections are member of $el prop.
const chart = bb.generate({});

chart.internal.width;
// --> chart.internal.state.width

chart.internal.selectChart;
// --> chart.internal.$el.chart

Do not extend APIs as own member

When chart is instantiated, APIs were assigned as own member to the instance. The reason mainly comes to handle namespaced APIs, like .data.shown().

const chart = bb.generate({});

chart;

1.x was extending methods from Chart.prototype, to its instance.

// 1.x
Chart { ... }
plugins: []
internal: ChartInternal {api: Chart, config: {…}, data: {…}, cache: {…}, axes: {…}, …}
$: {chart: Selection, svg: Selection, defs: Selection, main: Selection, tooltip: Selection, …}
element: div.bb
focus: Æ’ ()
defocus: Æ’ ()
...

2.x avoid extending as possible. Only will extend those namespaced APIs to keep the backward compatibility.

// 2.x
Chart { ... }
plugins: []
internal: ChartInternal {api: Chart, config: {…}, cache: Cache, state: {…}, charts: Array(1), …}
axis: {labels: Æ’, min: Æ’, max: Æ’, range: Æ’}
data: Æ’ ()
xgrids: Æ’ ()
ygrids: Æ’ ()
legend: {show: Æ’, hide: Æ’}
regions: Æ’ ()
tooltip: {show: Æ’, hide: Æ’}
zoom: Æ’ ()
$: {chart: Selection, svg: Selection, defs: Selection, main: Selection, tooltip: Selection, …}
element: div.bb

About

📊 Re-usable, easy interface JavaScript chart library based on D3.js

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.3%
  • SCSS 2.1%
  • JavaScript 1.3%
  • Other 0.3%