@visactor/vseed 0.0.5 → 0.0.7

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.
Files changed (57) hide show
  1. package/dist/builder/builder/build.d.ts +2 -2
  2. package/dist/builder/builder/buildSpec.d.ts +2 -2
  3. package/dist/builder/builder/builder.d.ts +8 -5
  4. package/dist/builder/register/chartType.d.ts +1 -0
  5. package/dist/dataReshape/constant.d.ts +1 -1
  6. package/dist/dataReshape/dataReshapeFor1D1M.d.ts +6 -1
  7. package/dist/dataReshape/dataReshapeFor2D1M.d.ts +6 -1
  8. package/dist/index.cjs +1174 -349
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.js +920 -104
  11. package/dist/index.js.map +1 -1
  12. package/dist/pipeline/advanced/pipeline/index.d.ts +1 -0
  13. package/dist/pipeline/advanced/pipeline/line copy.d.ts +2 -0
  14. package/dist/pipeline/advanced/pipeline/pie.d.ts +2 -0
  15. package/dist/pipeline/advanced/pipes/encoding/encodingPolar.d.ts +2 -0
  16. package/dist/pipeline/advanced/pipes/encoding/{encodingCartesian.d.ts → encodingXY copy.d.ts } +0 -1
  17. package/dist/pipeline/advanced/pipes/encoding/encodingXY.d.ts +2 -0
  18. package/dist/pipeline/advanced/pipes/encoding/encodingYX.d.ts +2 -0
  19. package/dist/pipeline/advanced/pipes/encoding/index.d.ts +3 -1
  20. package/dist/pipeline/advanced/pipes/index.d.ts +1 -0
  21. package/dist/pipeline/advanced/pipes/pivot/index.d.ts +1 -0
  22. package/dist/pipeline/advanced/pipes/pivot/pivotAdapter.d.ts +2 -0
  23. package/dist/pipeline/advanced/pipes/reshape/index.d.ts +2 -0
  24. package/dist/pipeline/advanced/pipes/reshape/pivotReshapeTo1D1M.d.ts +8 -0
  25. package/dist/pipeline/advanced/pipes/reshape/pivotReshapeTo2D1M.d.ts +8 -0
  26. package/dist/pipeline/spec/pipeline/area.d.ts +1 -2
  27. package/dist/pipeline/spec/pipeline/areaPercent.d.ts +1 -2
  28. package/dist/pipeline/spec/pipeline/column.d.ts +1 -2
  29. package/dist/pipeline/spec/pipeline/index.d.ts +1 -0
  30. package/dist/pipeline/spec/pipeline/pie.d.ts +2 -0
  31. package/dist/pipeline/spec/pipes/dataset/datasetPivot.d.ts +3 -0
  32. package/dist/pipeline/spec/pipes/dataset/index.d.ts +1 -0
  33. package/dist/pipeline/spec/pipes/index.d.ts +1 -0
  34. package/dist/pipeline/spec/pipes/init/index.d.ts +2 -0
  35. package/dist/pipeline/spec/pipes/init/line copy.d.ts +2 -0
  36. package/dist/pipeline/spec/pipes/init/pie.d.ts +2 -0
  37. package/dist/pipeline/spec/pipes/init/pivot.d.ts +4 -0
  38. package/dist/pipeline/spec/pipes/legend/index.d.ts +1 -0
  39. package/dist/pipeline/spec/pipes/legend/pivotLegend.d.ts +2 -0
  40. package/dist/pipeline/spec/pipes/pivotChart/index.d.ts +5 -0
  41. package/dist/pipeline/spec/pipes/pivotChart/pivotAdapter.d.ts +2 -0
  42. package/dist/pipeline/spec/pipes/pivotChart/pivotColumnDimensions.d.ts +2 -0
  43. package/dist/pipeline/spec/pipes/pivotChart/pivotGridStyle copy.d.ts +2 -0
  44. package/dist/pipeline/spec/pipes/pivotChart/pivotGridStyle.d.ts +2 -0
  45. package/dist/pipeline/spec/pipes/pivotChart/pivotIndicators.d.ts +4 -0
  46. package/dist/pipeline/spec/pipes/pivotChart/pivotRowDimensions copy.d.ts +2 -0
  47. package/dist/pipeline/spec/pipes/pivotChart/pivotRowDimensions.d.ts +2 -0
  48. package/dist/pipeline/utils/chatType.d.ts +37 -1
  49. package/dist/pipeline/utils/index.d.ts +1 -1
  50. package/dist/types/advancedVSeed.d.ts +3 -2
  51. package/dist/types/builder/builder.d.ts +3 -3
  52. package/dist/types/builder/index.d.ts +1 -0
  53. package/dist/types/builder/spec.d.ts +3 -0
  54. package/dist/types/pipeline/spec/spec.d.ts +2 -2
  55. package/dist/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +3 -2
  56. package/dist/types/properties/datasetReshapeInfo/index.d.ts +1 -1
  57. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import type { AdvancedPipe } from '../../../../types';
2
+ /**
3
+ * 数据重塑为透视结构, 如果存在指标分组, 则将数据按组划分. 如果存在行列维度, 则生成行列树结构.
4
+ * @param advancedVSeed
5
+ * @param context
6
+ * @returns
7
+ */
8
+ export declare const pivotReshapeTo2D1M: AdvancedPipe;
@@ -1,2 +1 @@
1
- import type { SpecPipeline } from '../../../types';
2
- export declare const areaSpecPipeline: SpecPipeline;
1
+ export declare const areaSpecPipeline: import("../../../types").SpecPipe[];
@@ -1,2 +1 @@
1
- import type { SpecPipeline } from '../../../types';
2
- export declare const areaPercentSpecPipeline: SpecPipeline;
1
+ export declare const areaPercentSpecPipeline: import("../../../types").SpecPipe[];
@@ -1,2 +1 @@
1
- import type { SpecPipeline } from '../../../types';
2
- export declare const columnSpecPipeline: SpecPipeline;
1
+ export declare const columnSpecPipeline: import("../../../types").SpecPipe[];
@@ -7,3 +7,4 @@ export { barParallelSpecPipeline } from './barParallel';
7
7
  export { barPercentSpecPipeline } from './barPercent';
8
8
  export { areaSpecPipeline } from './area';
9
9
  export { areaPercentSpecPipeline } from './areaPercent';
10
+ export { pieSpecPipeline } from './pie';
@@ -0,0 +1,2 @@
1
+ import type { SpecPipeline } from '../../../types';
2
+ export declare const pieSpecPipeline: SpecPipeline;
@@ -0,0 +1,3 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const datasetPivot: SpecPipe;
3
+ export declare const datasetPivotPlaceholder: SpecPipe;
@@ -1 +1,2 @@
1
1
  export { dataset } from './dataset';
2
+ export { datasetPivot, datasetPivotPlaceholder } from './datasetPivot';
@@ -8,3 +8,4 @@ export * from './tooltip';
8
8
  export * from './label';
9
9
  export * from './legend';
10
10
  export * from './color';
11
+ export * from './pivotChart';
@@ -4,3 +4,5 @@ export { initBarParallel } from './barParallel';
4
4
  export { initArea } from './area';
5
5
  export { initLine } from './line';
6
6
  export { initColumnParallel } from './columnParallel';
7
+ export { initPie } from './pie';
8
+ export { initPivot } from './pivot';
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const initLine: SpecPipe;
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const initPie: SpecPipe;
@@ -0,0 +1,4 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const initPivot: SpecPipe;
3
+ export declare const pivotIndicatorsAsRow: SpecPipe;
4
+ export declare const pivotIndicatorsAsCol: SpecPipe;
@@ -1 +1,2 @@
1
1
  export { legend } from './legend';
2
+ export { pivotLegend } from './pivotLegend';
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const pivotLegend: SpecPipe;
@@ -0,0 +1,5 @@
1
+ export { pivotAdapter } from './pivotAdapter';
2
+ export { pivotIndicators, pivotIndicatorsAsRow, pivotIndicatorsAsCol } from './pivotIndicators';
3
+ export { pivotGridStyle } from './pivotGridStyle';
4
+ export { pivotColumnDimensions } from './pivotColumnDimensions';
5
+ export { pivotRowDimensions } from './pivotRowDimensions';
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe, SpecPipeline } from '../../../../types';
2
+ export declare const pivotAdapter: (pipeline: SpecPipeline, pivotPipeline: SpecPipeline) => SpecPipe;
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const pivotColumnDimensions: SpecPipe;
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const pivotGridStyle: SpecPipe;
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const pivotGridStyle: SpecPipe;
@@ -0,0 +1,4 @@
1
+ import type { SpecPipe, SpecPipeline } from '../../../../types';
2
+ export declare const pivotIndicators: (chartPipeline: SpecPipeline) => SpecPipe;
3
+ export declare const pivotIndicatorsAsRow: SpecPipe;
4
+ export declare const pivotIndicatorsAsCol: SpecPipe;
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const pivotGridStyle: SpecPipe;
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const pivotRowDimensions: SpecPipe;
@@ -1,3 +1,39 @@
1
- import type { ChartType } from '../../types';
1
+ import type { AdvancedVSeed, ChartType, VSeed } from '../../types';
2
2
  export declare const isVTable: (chartType: ChartType) => boolean;
3
3
  export declare const isVChart: (chartType: ChartType) => boolean;
4
+ export declare const isPivotChart: (vseed: VSeed | AdvancedVSeed) => true | {
5
+ id: string;
6
+ alias?: string | undefined;
7
+ visible?: boolean | undefined;
8
+ autoFormat?: boolean | undefined;
9
+ format?: {
10
+ type: "number" | "percent" | "permille";
11
+ ratio: number;
12
+ symbol: string;
13
+ thousandSeparator: boolean;
14
+ decimalPlaces: number;
15
+ round: "round" | "floor" | "ceil";
16
+ prefix: string;
17
+ suffix: string;
18
+ } | undefined;
19
+ } | {
20
+ id: string;
21
+ alias?: string | undefined;
22
+ visible?: boolean | undefined;
23
+ children?: ({
24
+ id: string;
25
+ alias?: string | undefined;
26
+ visible?: boolean | undefined;
27
+ autoFormat?: boolean | undefined;
28
+ format?: {
29
+ type: "number" | "percent" | "permille";
30
+ ratio: number;
31
+ symbol: string;
32
+ thousandSeparator: boolean;
33
+ decimalPlaces: number;
34
+ round: "round" | "floor" | "ceil";
35
+ prefix: string;
36
+ suffix: string;
37
+ } | undefined;
38
+ } | /*elided*/ any)[] | undefined;
39
+ } | undefined;
@@ -1,2 +1,2 @@
1
1
  export { execPipeline } from './pipeline';
2
- export { isVTable, isVChart } from './chatType';
2
+ export { isVTable, isVChart, isPivotChart } from './chatType';
@@ -18,7 +18,8 @@ export declare const zAdvancedVSeed: z.ZodObject<{
18
18
  dualAxis: "dualAxis";
19
19
  }>;
20
20
  dataset: z.ZodArray<z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>>;
21
- datasetReshapeInfo: z.ZodObject<{
21
+ datasetReshapeInfo: z.ZodArray<z.ZodObject<{
22
+ id: z.ZodString;
22
23
  foldInfo: z.ZodObject<{
23
24
  foldMap: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodUndefined]>>;
24
25
  measureId: z.ZodString;
@@ -29,7 +30,7 @@ export declare const zAdvancedVSeed: z.ZodObject<{
29
30
  colorItems: z.ZodArray<z.ZodString>;
30
31
  groupName: z.ZodString;
31
32
  }, z.core.$strip>;
32
- }, z.core.$strip>;
33
+ }, z.core.$strip>>;
33
34
  dimensions: z.ZodOptional<z.ZodArray<z.ZodObject<{
34
35
  id: z.ZodString;
35
36
  alias: z.ZodOptional<z.ZodString>;
@@ -1,12 +1,12 @@
1
- import type { ISpec } from '@visactor/vchart';
1
+ import type { Spec } from '..';
2
2
  import type { ChartType, CustomThemeConfig } from '../properties';
3
3
  import type { VSeed } from '../chartType';
4
4
  import type { AdvancedPipeline, SpecPipeline } from '../pipeline';
5
5
  import type { AdvancedVSeed } from '../advancedVSeed';
6
6
  export interface VSeedBuilder {
7
- build: () => ISpec;
7
+ build: () => Spec;
8
8
  buildAdvanced: () => AdvancedVSeed | null;
9
- buildSpec: (advancedVSeed: AdvancedVSeed) => ISpec;
9
+ buildSpec: (advancedVSeed: AdvancedVSeed) => Spec;
10
10
  getAdvancedPipeline: (chartType: ChartType) => AdvancedPipeline;
11
11
  getSpecPipeline: (chartType: ChartType) => SpecPipeline;
12
12
  getTheme: (themeKey: string) => CustomThemeConfig;
@@ -1 +1,2 @@
1
1
  export type * from './builder';
2
+ export type * from './spec';
@@ -0,0 +1,3 @@
1
+ import type { PivotChartConstructorOptions, PivotTableConstructorOptions, ListTableConstructorOptions } from '@visactor/vtable';
2
+ import type { ISpec } from '@visactor/vchart';
3
+ export type Spec = ISpec | PivotChartConstructorOptions | PivotTableConstructorOptions | ListTableConstructorOptions;
@@ -1,4 +1,4 @@
1
- import type { ISpec } from '@visactor/vchart';
1
+ import type { Spec } from '../..';
2
2
  import type { Pipe } from '../pipeline';
3
3
  import type { VSeed } from '../../chartType';
4
4
  import type { AdvancedVSeed } from '../../advancedVSeed';
@@ -6,5 +6,5 @@ export type SpecPipelineContext = {
6
6
  vseed: VSeed;
7
7
  advancedVSeed: AdvancedVSeed;
8
8
  };
9
- export type SpecPipe = Pipe<ISpec, SpecPipelineContext>;
9
+ export type SpecPipe = Pipe<Spec, SpecPipelineContext>;
10
10
  export type SpecPipeline = SpecPipe[];
@@ -19,7 +19,8 @@ export declare const zUnfoldInfo: z.ZodObject<{
19
19
  colorItems: z.ZodArray<z.ZodString>;
20
20
  groupName: z.ZodString;
21
21
  }, z.core.$strip>;
22
- export declare const zDatasetReshapeInfo: z.ZodObject<{
22
+ export declare const zDatasetReshapeInfo: z.ZodArray<z.ZodObject<{
23
+ id: z.ZodString;
23
24
  foldInfo: z.ZodObject<{
24
25
  foldMap: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodUndefined]>>;
25
26
  measureId: z.ZodString;
@@ -30,5 +31,5 @@ export declare const zDatasetReshapeInfo: z.ZodObject<{
30
31
  colorItems: z.ZodArray<z.ZodString>;
31
32
  groupName: z.ZodString;
32
33
  }, z.core.$strip>;
33
- }, z.core.$strip>;
34
+ }, z.core.$strip>>;
34
35
  export type DatasetReshapeInfo = z.infer<typeof zDatasetReshapeInfo>;
@@ -1,2 +1,2 @@
1
1
  export { zDatasetReshapeInfo, zFoldInfo, zUnfoldInfo } from './datasetReshapeInfo';
2
- export type { FoldInfo, UnfoldInfo } from './datasetReshapeInfo';
2
+ export type { FoldInfo, UnfoldInfo, DatasetReshapeInfo } from './datasetReshapeInfo';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vseed",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {