d3fc-flexi-chart
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "d3fc-flexi-chart", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A flexible alternative to the d3fc cartesian chart", | ||
"license": "MIT", | ||
"main": "build/d3fc-flexi-chart.js", | ||
"module": "index", | ||
"homepage": "https://github.com/DevAndyLee/d3fc-flexi-chart", | ||
"main": "index", | ||
"scripts": { | ||
@@ -24,2 +24,3 @@ "build": "rollup -c", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-node-resolve": "^4.2.4", | ||
"uglify-js": "^3.5.11" | ||
@@ -26,0 +27,0 @@ }, |
@@ -43,3 +43,3 @@ # d3fc-flexi-chart | ||
.bottomLabel('Value') | ||
.layers( | ||
.layers([ | ||
fcFlexi.svgLayer(d3.scaleLinear(), d3.scaleLinear()) | ||
@@ -50,3 +50,3 @@ .yOrient('left') | ||
.plotArea(multiSvg) | ||
); | ||
]); | ||
``` | ||
@@ -58,2 +58,4 @@ | ||
For example, here's a chart with 3 layers, each sharing the same xScale but having different yScales. | ||
<img src="screenshots/flexi-layers.png"> | ||
@@ -67,3 +69,3 @@ | ||
The following code renders a Cartesian chart: | ||
The following code renders a chart: | ||
@@ -70,0 +72,0 @@ ```javascript |
@@ -1,2 +0,3 @@ | ||
var babel = require('rollup-plugin-babel'); | ||
import babel from 'rollup-plugin-babel'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
@@ -6,3 +7,4 @@ const packageName = 'd3fc-flexi-chart'; | ||
const external = function (key) { | ||
return (key.indexOf('d3-') === 0) || (key.indexOf('@d3fc/') === 0); | ||
return (key.indexOf('d3-') === 0) | ||
|| (key.indexOf('@d3fc/') === 0); | ||
}; | ||
@@ -32,7 +34,8 @@ const globals = function (key) { | ||
presets: [ | ||
['@babel/preset-env', { modules: false } ] | ||
['@babel/preset-env'] | ||
] | ||
}) | ||
}), | ||
resolve({ mainFields: ['module'] }) | ||
], | ||
external | ||
} |
@@ -23,3 +23,3 @@ import { select, event } from 'd3-selection'; | ||
const layerDataJoin = function dataJoin(container, data) { | ||
const layerDataJoin = (container, data) => { | ||
const selected = container.selectAll('.plot-area'); | ||
@@ -92,4 +92,5 @@ const update = selected.data(data, d => d); | ||
layerDataJoin(container, layers) | ||
.on('measure', (layer) => { | ||
.on('measure', (d, i, nodes) => { | ||
const { width, height } = event.detail; | ||
const layer = layers[i]; | ||
// Set the ranges on this layer | ||
@@ -99,3 +100,4 @@ layer.yScale().range([height, 0]); | ||
}) | ||
.on('draw', (layer, i, nodes) => { | ||
.on('draw', (d, i, nodes) => { | ||
const layer = layers[i]; | ||
const surface = (layer.element == 'd3fc-svg') ? 'svg' : 'canvas'; | ||
@@ -102,0 +104,0 @@ const layerData = mapping(data, i, layers); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
1
260
1
84973
6
19
496