From beebdb2db2dedc2ca0d36f9feb3f73505c69c4b5 Mon Sep 17 00:00:00 2001 From: Xing Yun Date: Fri, 23 Mar 2018 21:42:29 -0400 Subject: [PATCH 1/3] cleanup --- demo/index.html | 24 +----------------------- src/canvas/helper/radial-gradient.js | 1 - 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/demo/index.html b/demo/index.html index d7fcc35..6fc9f39 100644 --- a/demo/index.html +++ b/demo/index.html @@ -45,28 +45,6 @@ - -
Colorspace Network
-
- - -
Colorspace Selector
-
- - -
Color Tiles
-
- -
Twitter
-
- - -
Stackoverflow
-
- - -
Keiko
-
- +None \ No newline at end of file diff --git a/src/canvas/helper/radial-gradient.js b/src/canvas/helper/radial-gradient.js index 8074500..95941ce 100644 --- a/src/canvas/helper/radial-gradient.js +++ b/src/canvas/helper/radial-gradient.js @@ -1,4 +1,3 @@ -import { hsl } from 'd3-color'; import linearStops from '../../color/filter/linear-stops'; /** From 7a8d862c9172f4311f49159f7fe0544f7c822ebf Mon Sep 17 00:00:00 2001 From: Xing Yun Date: Fri, 23 Mar 2018 21:52:13 -0400 Subject: [PATCH 2/3] refactor layers --- src/baseChart/index.js | 4 ---- src/color/scale/generic.js | 2 +- src/index.js | 2 +- src/{baseChart => layer}/Globals.js | 0 src/{baseChart/canvasChart.js => layer/canvasLayer.js} | 4 ++-- src/{baseChart => layer}/compose.js | 0 src/layer/index.js | 4 ++++ src/{baseChart/svgChart.js => layer/svgLayer.js} | 4 ++-- src/options/DefaultCategoricalColor.js | 2 +- src/options/DefaultSequentialColor.js | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 src/baseChart/index.js rename src/{baseChart => layer}/Globals.js (100%) rename src/{baseChart/canvasChart.js => layer/canvasLayer.js} (91%) rename src/{baseChart => layer}/compose.js (100%) create mode 100644 src/layer/index.js rename src/{baseChart/svgChart.js => layer/svgLayer.js} (87%) diff --git a/src/baseChart/index.js b/src/baseChart/index.js deleted file mode 100644 index 2bb8c4e..0000000 --- a/src/baseChart/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export { default as svg } from './svgChart'; -export { default as canvas } from './canvasChart'; -export { default as Globals } from './Globals'; -export * from './compose'; diff --git a/src/color/scale/generic.js b/src/color/scale/generic.js index 4550cd8..683ee89 100644 --- a/src/color/scale/generic.js +++ b/src/color/scale/generic.js @@ -1,6 +1,6 @@ import { max } from 'd3-array'; -import Globals from '../../baseChart/Globals'; +import Globals from '../../layer/Globals'; import gradientColor from './gradient'; import distinctColor from './distinct'; diff --git a/src/index.js b/src/index.js index 4ec3431..2d282d8 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ export { version } from '../package.json'; -export * from './baseChart'; +export * from './layer'; export * from './color'; export * from './options'; export * from './util'; diff --git a/src/baseChart/Globals.js b/src/layer/Globals.js similarity index 100% rename from src/baseChart/Globals.js rename to src/layer/Globals.js diff --git a/src/baseChart/canvasChart.js b/src/layer/canvasLayer.js similarity index 91% rename from src/baseChart/canvasChart.js rename to src/layer/canvasLayer.js index 0e00748..0d4b0d4 100644 --- a/src/baseChart/canvasChart.js +++ b/src/layer/canvasLayer.js @@ -23,7 +23,7 @@ const CanvasState = { _animationState: null, }; -const canvas = (containerId, opt, composers = defaultComposers) => { +const canvasLayer = (containerId, opt, composers = defaultComposers) => { const state = Object.assign( {}, initState(containerId, opt, composers), @@ -43,4 +43,4 @@ const canvas = (containerId, opt, composers = defaultComposers) => { ); }; -export default canvas; +export default canvasLayer; diff --git a/src/baseChart/compose.js b/src/layer/compose.js similarity index 100% rename from src/baseChart/compose.js rename to src/layer/compose.js diff --git a/src/layer/index.js b/src/layer/index.js new file mode 100644 index 0000000..78093bf --- /dev/null +++ b/src/layer/index.js @@ -0,0 +1,4 @@ +export { default as svgLayer } from './svgLayer'; +export { default as canvasLayer } from './canvasLayer'; +export { default as Globals } from './Globals'; +export * from './compose'; diff --git a/src/baseChart/svgChart.js b/src/layer/svgLayer.js similarity index 87% rename from src/baseChart/svgChart.js rename to src/layer/svgLayer.js index 2e6d1c5..7a61cef 100644 --- a/src/baseChart/svgChart.js +++ b/src/layer/svgLayer.js @@ -15,7 +15,7 @@ const defaultComposers = { color: (color, data, opt) => genericColor(color), }; -const svg = (containerId, opt, composers = defaultComposers) => { +const svgLayer = (containerId, opt, composers = defaultComposers) => { const state = initState(containerId, opt, composers); return Object.assign( @@ -29,4 +29,4 @@ const svg = (containerId, opt, composers = defaultComposers) => { ); }; -export default svg; +export default svgLayer; diff --git a/src/options/DefaultCategoricalColor.js b/src/options/DefaultCategoricalColor.js index 24fac13..a9882bd 100644 --- a/src/options/DefaultCategoricalColor.js +++ b/src/options/DefaultCategoricalColor.js @@ -1,4 +1,4 @@ -import Globals from '../baseChart/Globals'; +import Globals from '../layer/Globals'; import { TheMetLight } from '../color/preset/metropolis'; const DefaultCategoricalColor = { diff --git a/src/options/DefaultSequentialColor.js b/src/options/DefaultSequentialColor.js index 40de5f3..1ecd07e 100644 --- a/src/options/DefaultSequentialColor.js +++ b/src/options/DefaultSequentialColor.js @@ -1,4 +1,4 @@ -import Globals from '../baseChart/Globals'; +import Globals from '../layer/Globals'; import { MetroRain3 } from '../color/preset/metropolis'; const DefaultSequentialColor = { From cbc1c27dd6d231a9e4630af99f93000400b7553a Mon Sep 17 00:00:00 2001 From: Xing Yun Date: Fri, 23 Mar 2018 21:54:43 -0400 Subject: [PATCH 3/3] bump to 2.0.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4677517..d401734 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vizart-core", - "version": "2.0.0-rc.0", + "version": "2.0.0-rc.1", "description": "Core Components for VizArt", "main": "dist/vizart-core.js", "module": "dist/vizart-core.mjs",