@orbcharts/plugins-basic 3.0.0-alpha.56 → 3.0.0-alpha.58

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ import { parseTickFormatValue } from '../../utils/d3Utils'
24
24
  import { measureTextWidth } from '../../utils/commonUtils'
25
25
  import { getColor, getClassName, getUniID } from '../../utils/orbchartsUtils'
26
26
  import { d3EventObservable } from '../../utils/observables'
27
- import { gridGroupPositionFnObservable } from '../gridObservables'
27
+ import { gridGroupPosition } from '../gridObservables'
28
28
  import { createAxisPointScale } from '@orbcharts/core'
29
29
  import type { GroupAuxParams } from '../types'
30
30
  import { gridSelectionsObservable } from '../gridObservables'
@@ -65,7 +65,7 @@ function createLineData ({ groupLabel, axisX, axisHeight, fullParams }: {
65
65
  }
66
66
 
67
67
  function renderLine ({ selection, pluginName, lineData, fullParams, fullChartParams }: {
68
- selection: d3.Selection<any, unknown, any, unknown>
68
+ selection: d3.Selection<any, string, any, unknown>
69
69
  pluginName: string
70
70
  lineData: LineDatum[]
71
71
  fullParams: GroupAuxParams
@@ -106,7 +106,7 @@ function renderLine ({ selection, pluginName, lineData, fullParams, fullChartPar
106
106
  return auxLineSelection
107
107
  }
108
108
 
109
- function removeLine (selection: d3.Selection<any, unknown, any, unknown>) {
109
+ function removeLine (selection: d3.Selection<any, string, any, unknown>) {
110
110
  const update = selection
111
111
  .selectAll<SVGLineElement, LineDatum>('line')
112
112
  .data([])
@@ -130,7 +130,7 @@ function createLabelData ({ groupLabel, axisX, fullParams }: {
130
130
  }
131
131
 
132
132
  function renderLabel ({ selection, labelData, fullParams, fullDataFormatter, fullChartParams, labelTransform, textSizePx }: {
133
- selection: d3.Selection<any, unknown, any, unknown>
133
+ selection: d3.Selection<any, string, any, unknown>
134
134
  labelData: LabelDatum[]
135
135
  fullParams: GroupAuxParams
136
136
  fullDataFormatter: DataFormatterGrid
@@ -168,7 +168,9 @@ function renderLabel ({ selection, labelData, fullParams, fullDataFormatter, ful
168
168
  let rectX = - rectWidth / 2
169
169
  let rectY = -2
170
170
  if (fullDataFormatter.grid.groupAxis.position === 'bottom') {
171
- rectX = - rectWidth / 2
171
+ rectX = fullParams.labelRotate
172
+ ? - rectWidth
173
+ : - rectWidth / 2
172
174
  rectY = 2
173
175
  } else if (fullDataFormatter.grid.groupAxis.position === 'left') {
174
176
  rectX = - rectWidth + 2
@@ -177,7 +179,9 @@ function renderLabel ({ selection, labelData, fullParams, fullDataFormatter, ful
177
179
  rectX = - 2
178
180
  rectY = - rectHeight / 2
179
181
  } else if (fullDataFormatter.grid.groupAxis.position === 'top') {
180
- rectX = - rectWidth / 2
182
+ rectX = fullParams.labelRotate
183
+ ? - rectWidth
184
+ : - rectWidth / 2
181
185
  rectY = - rectHeight + 2
182
186
  }
183
187
 
@@ -222,7 +226,7 @@ function renderLabel ({ selection, labelData, fullParams, fullDataFormatter, ful
222
226
  return axisLabelSelection
223
227
  }
224
228
 
225
- function removeLabel (selection: d3.Selection<any, unknown, any, unknown>) {
229
+ function removeLabel (selection: d3.Selection<any, string, any, unknown>) {
226
230
  const gUpdate = selection
227
231
  .selectAll<SVGGElement, LabelDatum>(`g.${labelClassName}`)
228
232
  .data([])
@@ -352,15 +356,65 @@ export const GroupAux = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)(
352
356
  // distinctUntilChanged()
353
357
  // )
354
358
 
355
- const groupScale$: Observable<d3.ScalePoint<string>> = new Observable(subscriber => {
356
- combineLatest({
357
- fullDataFormatter: observer.fullDataFormatter$,
358
- gridAxesSize: observer.gridAxesSize$,
359
- computedData: observer.computedData$
360
- }).pipe(
361
- takeUntil(destroy$),
362
- switchMap(async (d) => d),
363
- ).subscribe(data => {
359
+ // const groupScale$: Observable<d3.ScalePoint<string>> = new Observable(subscriber => {
360
+ // combineLatest({
361
+ // fullDataFormatter: observer.fullDataFormatter$,
362
+ // gridAxesSize: observer.gridAxesSize$,
363
+ // computedData: observer.computedData$
364
+ // }).pipe(
365
+ // takeUntil(destroy$),
366
+ // switchMap(async (d) => d),
367
+ // ).subscribe(data => {
368
+ // const groupMin = 0
369
+ // const groupMax = data.computedData[0] ? data.computedData[0].length - 1 : 0
370
+ // const groupScaleDomainMin = data.fullDataFormatter.grid.groupAxis.scaleDomain[0] === 'auto'
371
+ // ? groupMin - data.fullDataFormatter.grid.groupAxis.scalePadding
372
+ // : data.fullDataFormatter.grid.groupAxis.scaleDomain[0] as number - data.fullDataFormatter.grid.groupAxis.scalePadding
373
+ // const groupScaleDomainMax = data.fullDataFormatter.grid.groupAxis.scaleDomain[1] === 'auto'
374
+ // ? groupMax + data.fullDataFormatter.grid.groupAxis.scalePadding
375
+ // : data.fullDataFormatter.grid.groupAxis.scaleDomain[1] as number + data.fullDataFormatter.grid.groupAxis.scalePadding
376
+
377
+ // const groupingLength = data.computedData[0]
378
+ // ? data.computedData[0].length
379
+ // : 0
380
+
381
+ // let _labels = data.fullDataFormatter.grid.seriesDirection === 'row'
382
+ // // ? data.fullDataFormatter.grid.columnLabels
383
+ // // : data.fullDataFormatter.grid.rowLabels
384
+ // ? (data.computedData[0] ?? []).map(d => d.groupLabel)
385
+ // : data.computedData.map(d => d[0].groupLabel)
386
+
387
+ // const axisLabels = new Array(groupingLength).fill(0)
388
+ // .map((d, i) => {
389
+ // return _labels[i] != null
390
+ // ? _labels[i]
391
+ // : String(i) // 沒有label則用序列號填充
392
+ // })
393
+ // .filter((d, i) => {
394
+ // return i >= groupScaleDomainMin && i <= groupScaleDomainMax
395
+ // })
396
+
397
+
398
+ // const padding = data.fullDataFormatter.grid.groupAxis.scalePadding
399
+
400
+ // const groupScale = createAxisPointScale({
401
+ // axisLabels,
402
+ // axisWidth: data.gridAxesSize.width,
403
+ // padding
404
+ // })
405
+
406
+ // subscriber.next(groupScale)
407
+ // })
408
+ // })
409
+
410
+ const groupScaleDomain$ = combineLatest({
411
+ fullDataFormatter: observer.fullDataFormatter$,
412
+ gridAxesSize: observer.gridAxesSize$,
413
+ computedData: observer.computedData$
414
+ }).pipe(
415
+ takeUntil(destroy$),
416
+ switchMap(async (d) => d),
417
+ map(data => {
364
418
  const groupMin = 0
365
419
  const groupMax = data.computedData[0] ? data.computedData[0].length - 1 : 0
366
420
  const groupScaleDomainMin = data.fullDataFormatter.grid.groupAxis.scaleDomain[0] === 'auto'
@@ -369,47 +423,33 @@ export const GroupAux = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)(
369
423
  const groupScaleDomainMax = data.fullDataFormatter.grid.groupAxis.scaleDomain[1] === 'auto'
370
424
  ? groupMax + data.fullDataFormatter.grid.groupAxis.scalePadding
371
425
  : data.fullDataFormatter.grid.groupAxis.scaleDomain[1] as number + data.fullDataFormatter.grid.groupAxis.scalePadding
372
-
373
- const groupingLength = data.computedData[0]
374
- ? data.computedData[0].length
375
- : 0
376
-
377
- let _labels = data.fullDataFormatter.grid.seriesDirection === 'row'
378
- // ? data.fullDataFormatter.grid.columnLabels
379
- // : data.fullDataFormatter.grid.rowLabels
380
- ? (data.computedData[0] ?? []).map(d => d.groupLabel)
381
- : data.computedData.map(d => d[0].groupLabel)
382
-
383
- const axisLabels = new Array(groupingLength).fill(0)
384
- .map((d, i) => {
385
- return _labels[i] != null
386
- ? _labels[i]
387
- : String(i) // 沒有label則用序列號填充
388
- })
389
- .filter((d, i) => {
390
- return i >= groupScaleDomainMin && i <= groupScaleDomainMax
391
- })
392
426
 
393
-
394
- const padding = data.fullDataFormatter.grid.groupAxis.scalePadding
395
-
396
- const groupScale = createAxisPointScale({
397
- axisLabels,
398
- axisWidth: data.gridAxesSize.width,
399
- padding
400
- })
427
+ return [groupScaleDomainMin, groupScaleDomainMax]
428
+ }),
429
+ shareReplay(1)
430
+ )
401
431
 
402
- subscriber.next(groupScale)
432
+ const groupScale$ = combineLatest({
433
+ groupScaleDomain: groupScaleDomain$,
434
+ gridAxesSize: observer.gridAxesSize$
435
+ }).pipe(
436
+ takeUntil(destroy$),
437
+ switchMap(async (d) => d),
438
+ map(data => {
439
+ const groupScale: d3.ScaleLinear<number, number> = d3.scaleLinear()
440
+ .domain(data.groupScaleDomain)
441
+ .range([0, data.gridAxesSize.width])
442
+ return groupScale
403
443
  })
404
- })
444
+ )
405
445
 
406
- // 取得事件座標的group資料
407
- const gridGroupPositionFn$ = gridGroupPositionFnObservable({
408
- fullDataFormatter$: observer.fullDataFormatter$,
409
- gridAxesSize$: observer.gridAxesSize$,
410
- computedData$: observer.computedData$,
411
- fullChartParams$: observer.fullChartParams$,
412
- })
446
+ // // 取得事件座標的group資料
447
+ // const gridGroupPositionFn$ = gridGroupPositionFnObservable({
448
+ // fullDataFormatter$: observer.fullDataFormatter$,
449
+ // gridAxesSize$: observer.gridAxesSize$,
450
+ // computedData$: observer.computedData$,
451
+ // fullChartParams$: observer.fullChartParams$,
452
+ // })
413
453
 
414
454
  const highlightTarget$ = observer.fullChartParams$.pipe(
415
455
  takeUntil(destroy$),
@@ -562,10 +602,10 @@ export const GroupAux = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)(
562
602
  const containerScaleReverseScaleValue = `scale(${1 / data.gridContainerPosition[0].scale[0]}, ${1 / data.gridContainerPosition[0].scale[1]})`
563
603
  const tickTextRotateDeg = (data.fullDataFormatter.grid.groupAxis.position === 'left' && data.fullDataFormatter.grid.valueAxis.position === 'top')
564
604
  || (data.fullDataFormatter.grid.groupAxis.position === 'right' && data.fullDataFormatter.grid.valueAxis.position === 'bottom')
565
- // ? data.fullParams.tickTextRotate + 180 // 修正文字倒轉
566
- // : data.fullParams.tickTextRotate
567
- ? 180 // 修正文字倒轉
568
- : 0
605
+ ? data.fullParams.labelRotate + 180 // 修正文字倒轉
606
+ : data.fullParams.labelRotate
607
+ // ? 180 // 修正文字倒轉
608
+ // : 0
569
609
 
570
610
  const textRotateValue = `rotate(${tickTextRotateDeg}deg)`
571
611
 
@@ -597,13 +637,26 @@ export const GroupAux = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)(
597
637
  distinctUntilChanged()
598
638
  )
599
639
 
640
+ const gridGroupPosition$ = gridGroupPosition({
641
+ rootSelection,
642
+ fullDataFormatter$: observer.fullDataFormatter$,
643
+ gridAxesSize$: observer.gridAxesSize$,
644
+ computedData$: observer.computedData$,
645
+ fullChartParams$: observer.fullChartParams$,
646
+ gridContainerPosition$: observer.gridContainerPosition$,
647
+ layout$: observer.layout$
648
+ }).pipe(
649
+ takeUntil(destroy$)
650
+ )
651
+
600
652
  combineLatest({
601
653
  axesSelection: axesSelection$,
602
654
  columnAmount: columnAmount$,
603
655
  rowAmount: rowAmount$,
604
656
  layout: observer.layout$,
605
657
  rootMousemove: rootMousemove$,
606
- gridGroupPositionFn: gridGroupPositionFn$,
658
+ // gridGroupPositionFn: gridGroupPositionFn$,
659
+ gridGroupPosition: gridGroupPosition$,
607
660
  computedData: observer.computedData$,
608
661
  groupScale: groupScale$,
609
662
  gridAxesSize: observer.gridAxesSize$,
@@ -616,22 +669,23 @@ export const GroupAux = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)(
616
669
  GroupDataMap: observer.GroupDataMap$,
617
670
  textSizePx: observer.textSizePx$
618
671
  }).subscribe(data => {
619
- // 由於event座標是基於底層的,但是container會有多欄,所以要重新計算
620
- const eventData = {
621
- offsetX: data.rootMousemove.offsetX * data.columnAmount % data.layout.rootWidth,
622
- offsetY: data.rootMousemove.offsetY * data.rowAmount % data.layout.rootHeight
623
- }
672
+ // // 由於event座標是基於底層的,但是container會有多欄,所以要重新計算
673
+ // const eventData = {
674
+ // offsetX: data.rootMousemove.offsetX * data.columnAmount % data.layout.rootWidth,
675
+ // offsetY: data.rootMousemove.offsetY * data.rowAmount % data.layout.rootHeight
676
+ // }
624
677
  // 依event的座標取得group資料
625
- const { groupIndex, groupLabel } = data.gridGroupPositionFn(eventData)
626
-
627
- const axisX = data.groupScale(groupLabel) ?? 0
628
-
678
+ const { groupIndex, groupLabel } = data.gridGroupPosition
679
+ // console.log('gridGroupPosition', groupIndex, groupLabel)
680
+ const axisX = data.groupScale(groupIndex) ?? 0
681
+ // console.log('axisX', axisX)
629
682
  const lineData = createLineData({
630
683
  groupLabel: groupLabel,
631
684
  axisX,
632
685
  axisHeight: data.gridAxesSize.height,
633
686
  fullParams: data.fullParams,
634
687
  })
688
+ // console.log('lineData', lineData)
635
689
  renderLine({
636
690
  // selection: axisSelection,
637
691
  selection: data.axesSelection,
@@ -703,29 +757,29 @@ export const GroupAux = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)(
703
757
  data: data.computedData
704
758
  })
705
759
  })
706
- .on('mouseout', (event, datum) => {
707
- event.stopPropagation()
708
- // const { groupIndex, groupLabel } = data.gridGroupPositionFn(event)
709
-
710
- isLabelMouseover = false
711
-
712
- subject.event$.next({
713
- type: 'grid',
714
- pluginName: name,
715
- eventName: 'mouseout',
716
- highlightTarget: data.highlightTarget,
717
- datum: null,
718
- gridIndex: 0, // @Q@ 暫不處理
719
- series: [],
720
- seriesIndex: -1,
721
- seriesLabel: '',
722
- groups: data.GroupDataMap.get(groupLabel) ?? [],
723
- groupIndex,
724
- groupLabel,
725
- event,
726
- data: data.computedData
727
- })
728
- })
760
+ // .on('mouseout', (event, datum) => {
761
+ // event.stopPropagation()
762
+ // // const { groupIndex, groupLabel } = data.gridGroupPositionFn(event)
763
+
764
+ // isLabelMouseover = false
765
+
766
+ // subject.event$.next({
767
+ // type: 'grid',
768
+ // pluginName: name,
769
+ // eventName: 'mouseout',
770
+ // highlightTarget: data.highlightTarget,
771
+ // datum: null,
772
+ // gridIndex: 0, // @Q@ 暫不處理
773
+ // series: [],
774
+ // seriesIndex: -1,
775
+ // seriesLabel: '',
776
+ // groups: data.GroupDataMap.get(groupLabel) ?? [],
777
+ // groupIndex,
778
+ // groupLabel,
779
+ // event,
780
+ // data: data.computedData
781
+ // })
782
+ // })
729
783
  .on('click', (event, datum) => {
730
784
  event.stopPropagation()
731
785
  // const { groupIndex, groupLabel } = data.gridGroupPositionFn(event)
@@ -28,6 +28,7 @@ export const LineAreas = defineGridPlugin(pluginName, DEFAULT_LINE_AREAS_PARAMS)
28
28
  gridAxesSize$: observer.gridAxesSize$,
29
29
  gridHighlight$: observer.gridHighlight$,
30
30
  gridContainerPosition$: observer.gridContainerPosition$,
31
+ allContainerPosition$: observer.gridContainerPosition$,
31
32
  layout$: observer.layout$,
32
33
  event$: subject.event$,
33
34
  })
@@ -7,7 +7,7 @@ import { createBaseLines } from '../../base/BaseLines'
7
7
 
8
8
  const pluginName = 'Lines'
9
9
 
10
- export const Lines = defineGridPlugin(pluginName, DEFAULT_LINES_PARAMS)(({ selection, name, observer, subject }) => {
10
+ export const Lines = defineGridPlugin(pluginName, DEFAULT_LINES_PARAMS)(({ selection, rootSelection, name, observer, subject }) => {
11
11
 
12
12
  const destroy$ = new Subject()
13
13
 
@@ -28,6 +28,8 @@ export const Lines = defineGridPlugin(pluginName, DEFAULT_LINES_PARAMS)(({ selec
28
28
  gridAxesSize$: observer.gridAxesSize$,
29
29
  gridHighlight$: observer.gridHighlight$,
30
30
  gridContainerPosition$: observer.gridContainerPosition$,
31
+ allContainerPosition$: observer.gridContainerPosition$,
32
+ layout$: observer.layout$,
31
33
  event$: subject.event$,
32
34
  })
33
35
 
package/src/grid/types.ts CHANGED
@@ -38,6 +38,7 @@ export interface GroupAuxParams {
38
38
  labelTextColorType: ColorType
39
39
  labelTextFormat: string | ((text: any) => string)
40
40
  labelPadding: number
41
+ labelRotate: number
41
42
  }
42
43
 
43
44
  export interface BarsParams {
@@ -1,5 +1,6 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
+ map,
3
4
  takeUntil,
4
5
  Subject } from 'rxjs'
5
6
  import {
@@ -19,6 +20,14 @@ export const MultiLineAreas = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LI
19
20
 
20
21
  const unsubscribeFnArr: (() => void)[] = []
21
22
 
23
+ // 攤平所有grid的containerPosition
24
+ const allContainerPosition$ = observer.multiGridContainerPosition$.pipe(
25
+ takeUntil(destroy$),
26
+ map(data => {
27
+ return data.flat()
28
+ })
29
+ )
30
+
22
31
  const multiGridPluginDetail$ = multiGridPluginDetailObservables(observer)
23
32
 
24
33
  multiGridPluginDetail$
@@ -54,6 +63,7 @@ export const MultiLineAreas = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LI
54
63
  gridAxesSize$: d.gridAxesSize$,
55
64
  gridHighlight$: d.gridHighlight$,
56
65
  gridContainerPosition$: d.gridContainerPosition$,
66
+ allContainerPosition$: allContainerPosition$,
57
67
  layout$: observer.layout$,
58
68
  event$: subject.event$ as Subject<any>,
59
69
  })
@@ -1,5 +1,6 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
+ map,
3
4
  takeUntil,
4
5
  Subject } from 'rxjs'
5
6
  import {
@@ -14,11 +15,19 @@ const pluginName = 'MultiLines'
14
15
 
15
16
  const gridClassName = getClassName(pluginName, 'grid')
16
17
 
17
- export const MultiLines = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LINES_PARAMS)(({ selection, name, subject, observer }) => {
18
+ export const MultiLines = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LINES_PARAMS)(({ selection, rootSelection, name, subject, observer }) => {
18
19
  const destroy$ = new Subject()
19
20
 
20
21
  const unsubscribeFnArr: (() => void)[] = []
21
22
 
23
+ // 攤平所有grid的containerPosition
24
+ const allContainerPosition$ = observer.multiGridContainerPosition$.pipe(
25
+ takeUntil(destroy$),
26
+ map(data => {
27
+ return data.flat()
28
+ })
29
+ )
30
+
22
31
  const multiGridPluginDetail$ = multiGridPluginDetailObservables(observer)
23
32
 
24
33
  multiGridPluginDetail$
@@ -54,6 +63,8 @@ export const MultiLines = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LINES_
54
63
  gridAxesSize$: d.gridAxesSize$,
55
64
  gridHighlight$: d.gridHighlight$,
56
65
  gridContainerPosition$: d.gridContainerPosition$,
66
+ allContainerPosition$,
67
+ layout$: observer.layout$,
57
68
  event$: subject.event$ as Subject<any>,
58
69
  })
59
70
  })
@@ -3,7 +3,7 @@
3
3
  "outDir": "./dist/",
4
4
  "sourceMap": true,
5
5
  "noImplicitAny": true,
6
- "module": "es6",
6
+ "module": "esnext",
7
7
  "target": "es5",
8
8
  "jsx": "react",
9
9
  "allowJs": true,
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "paths":{
5
+ "@orbcharts/core": ["./../orbcharts-core/src"]
6
+ }
7
+ }
8
+ }
@@ -1,14 +1,3 @@
1
1
  {
2
- "compilerOptions": {
3
- "outDir": "./dist/",
4
- "sourceMap": true,
5
- "noImplicitAny": true,
6
- "module": "es6",
7
- "target": "es5",
8
- "jsx": "react",
9
- "allowJs": true,
10
- "moduleResolution": "node",
11
- "allowSyntheticDefaultImports" : true,
12
- "esModuleInterop" : true
13
- }
2
+ "extends": "./tsconfig.base.json"
14
3
  }
@@ -0,0 +1,41 @@
1
+ import path from "path"
2
+ import { defineConfig } from 'vite'
3
+ import dts from 'vite-plugin-dts'
4
+ import tsconfig from 'vite-plugin-tsconfig'
5
+
6
+ export default defineConfig(({ command, mode }) => {
7
+ const alias = mode === 'production'
8
+ ? {}
9
+ : {
10
+ "@orbcharts/core": path.resolve(__dirname, "./../orbcharts-core")
11
+ }
12
+
13
+ const tsconfigPath = mode === 'production'
14
+ ? 'tsconfig.prod.json'
15
+ : 'tsconfig.json'
16
+
17
+ return {
18
+ plugins: [
19
+ tsconfig({
20
+ filename: tsconfigPath
21
+ }),
22
+ dts({
23
+ insertTypesEntry: true
24
+ })
25
+ ],
26
+ resolve: {
27
+ alias
28
+ },
29
+ compilerOptions: {
30
+ composite: true
31
+ },
32
+ build: {
33
+ lib: {
34
+ entry: "src/index.ts",
35
+ name: 'orbcharts-plugins-basic',
36
+ formats: ["es", "umd"],
37
+ fileName: format => `orbcharts-plugins-basic.${format}.js`
38
+ },
39
+ }
40
+ }
41
+ })
@@ -1,2 +0,0 @@
1
- declare const _default: import('vite').UserConfig & Promise<import('vite').UserConfig> & (import('vite').UserConfigFnObject & import('vite').UserConfigExport);
2
- export default _default;
package/tsconfig.dev.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "./dist/",
4
- "sourceMap": true,
5
- "noImplicitAny": true,
6
- "module": "es6",
7
- "target": "es5",
8
- "jsx": "react",
9
- "allowJs": true,
10
- "moduleResolution": "node",
11
- "allowSyntheticDefaultImports" : true,
12
- "esModuleInterop" : true,
13
- "paths":{
14
- "@orbcharts/core": ["./../orbcharts-core/src"]
15
- }
16
- }
17
- }
package/vite.config.js DELETED
@@ -1,50 +0,0 @@
1
- // import { fileURLToPath, URL } from 'node:url'
2
-
3
- // import { resolve } from 'path'
4
- import { defineConfig } from 'vite'
5
- import dts from 'vite-plugin-dts'
6
-
7
- const releaseConfig = {
8
- plugins: [
9
- dts({
10
- insertTypesEntry: true
11
- })
12
- ],
13
- compilerOptions: {
14
- composite: true
15
- },
16
- // resolve: {
17
- // alias: {
18
- // '@core': '@orbcharts/core'
19
- // }
20
- // },
21
- build: {
22
- lib: {
23
- entry: "src/index.ts",
24
- name: 'orbcharts-plugins-basic',
25
- formats: ["es", "umd"],
26
- fileName: format => `orbcharts-plugins-basic.${format}.js`
27
- },
28
- // rollupOptions: {
29
- // input: {
30
- // main: resolve(__dirname, "src/index.ts")
31
- // },
32
- // external: ['vue'],
33
- // output: {
34
- // assetFileNames: 'my-library.css',
35
- // exports: "named",
36
- // globals: {
37
- // vue: 'Vue',
38
- // },
39
- // },
40
- // },
41
- }
42
- }
43
-
44
- export default defineConfig(({ command, mode }) => {
45
- if (mode === 'release') {
46
- return releaseConfig
47
- } else {
48
- return releaseConfig
49
- }
50
- })