@orbcharts/core 3.0.0-alpha.21 → 3.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/core",
3
- "version": "3.0.0-alpha.21",
3
+ "version": "3.0.0-alpha.23",
4
4
  "description": "OrbCharts is an open source chart library based on d3.js and rx.js",
5
5
  "author": "Blue Planet Inc.",
6
6
  "license": "Apache-2.0",
@@ -31,6 +31,7 @@
31
31
  "@types/d3": "^7.4.0",
32
32
  "ts-loader": "^9.4.2",
33
33
  "typescript": "^5.0.4",
34
+ "vite": "^5.3.5",
34
35
  "vite-plugin-dts": "^3.7.3"
35
36
  },
36
37
  "dependencies": {
@@ -103,8 +103,8 @@ export const createBaseChart: CreateBaseChart = <T extends ChartType>({ defaultD
103
103
  .attr('xmls', 'http://www.w3.org/2000/svg')
104
104
  .attr('version', '1.1')
105
105
  .style('position', 'absolute')
106
- .style('width', '100%')
107
- .style('height', '100%')
106
+ // .style('width', '100%')
107
+ // .style('height', '100%')
108
108
  .classed('orbcharts__root', true)
109
109
  // 傳入操作的 selection
110
110
  const selectionLayout = svgSelection.append('g')
@@ -226,6 +226,11 @@ export const createBaseChart: CreateBaseChart = <T extends ChartType>({ defaultD
226
226
  }),
227
227
  shareReplay(1)
228
228
  )
229
+ layout$.subscribe(d => {
230
+ svgSelection
231
+ .attr('width', d.rootWidth)
232
+ .attr('height', d.rootHeight)
233
+ })
229
234
 
230
235
  // -- computedData --
231
236
  const computedData$: Observable<ComputedDataTypeMap<T>> = combineLatest({
package/src/defaults.ts CHANGED
@@ -61,14 +61,14 @@ export const CHART_PARAMS_DEFAULT: ChartParams = {
61
61
  series: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
62
62
  primary: '#454545',
63
63
  secondary: '#e1e1e1',
64
- white: '#f0f0f0',
64
+ white: '#ffffff',
65
65
  background: '#ffffff'
66
66
  },
67
67
  dark: {
68
68
  series: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
69
69
  primary: '#f0f0f0',
70
70
  secondary: '#e1e1e1',
71
- white: '#f0f0f0',
71
+ white: '#ffffff',
72
72
  background: '#000000'
73
73
  }
74
74
  },
@@ -163,7 +163,11 @@ export const DATA_FORMATTER_SERIES_DEFAULT: DataFormatterSeries = {
163
163
  // return dataFormatter.seriesLabels[seriesIndex]
164
164
  // },
165
165
  colorsPredicate: (datum, rowIndex, columnIndex, { chartParams }) => {
166
- return chartParams.colors[chartParams.colorScheme].series[rowIndex]
166
+ return rowIndex < chartParams.colors[chartParams.colorScheme].series.length
167
+ ? chartParams.colors[chartParams.colorScheme].series[rowIndex]
168
+ : chartParams.colors[chartParams.colorScheme].series[
169
+ rowIndex % chartParams.colors[chartParams.colorScheme].series.length
170
+ ]
167
171
  },
168
172
  sort: null,
169
173
  }
package/src/types/Data.ts CHANGED
@@ -6,7 +6,7 @@ import { DataMultiValue, DataMultiValueDatum, DataMultiValueValue } from './Data
6
6
  import { DataTree, DataTreeDatum, DataTreeObj } from './DataTree'
7
7
  import { DataRelationship, Node, Edge } from './DataRelationship'
8
8
 
9
- // 基本欄位(皆為可選,無填寫則在 formatXX 程式中產生預設值)
9
+ // 基本欄位(皆為可選,無填寫則在計算時產生預設值)
10
10
  export interface DatumBase {
11
11
  id?: string
12
12
  label?: string
package/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- .DS_Store
2
- node_modules
3
- /dist
4
-
5
-
6
- # local env files
7
- .env.local
8
- .env.*.local
9
-
10
- # Log files
11
- npm-debug.log*
12
- yarn-debug.log*
13
- yarn-error.log*
14
- pnpm-debug.log*
15
-
16
- # Editor directories and files
17
- .idea
18
- .vscode
19
- *.suo
20
- *.ntvs*
21
- *.njsproj
22
- *.sln
23
- *.sw?