@visactor/vseed 0.1.23 → 0.1.24

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 (28) hide show
  1. package/dist/cjs/index.cjs +1 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js +1 -2
  4. package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js.map +1 -1
  5. package/dist/esm/pipeline/spec/chart/pipes/axes/format/linearFormat.d.ts +1 -0
  6. package/dist/esm/pipeline/spec/chart/pipes/axes/format/linearFormat.js +7 -1
  7. package/dist/esm/pipeline/spec/chart/pipes/axes/format/linearFormat.js.map +1 -1
  8. package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.js +1 -4
  9. package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.js.map +1 -1
  10. package/dist/esm/pipeline/spec/chart/pipes/axes/radarRadius.js +1 -4
  11. package/dist/esm/pipeline/spec/chart/pipes/axes/radarRadius.js.map +1 -1
  12. package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js +1 -4
  13. package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js.map +1 -1
  14. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +0 -11
  15. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
  16. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js +2 -14
  17. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js.map +1 -1
  18. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +0 -11
  19. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
  20. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js +2 -14
  21. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js.map +1 -1
  22. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js +0 -13
  23. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js.map +1 -1
  24. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js +0 -14
  25. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js.map +1 -1
  26. package/dist/umd/index.js +12 -87
  27. package/dist/umd/index.js.map +1 -1
  28. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -2668,17 +2668,6 @@
2668
2668
  const { measures, dimensions, encoding } = advancedVSeed;
2669
2669
  const config = advancedVSeed.config?.[chartType]?.xAxis;
2670
2670
  if (!result.axes) result.axes = [];
2671
- if (!config) {
2672
- result.axes = [
2673
- ...result.axes,
2674
- {
2675
- visible: true,
2676
- type: 'band',
2677
- orient: 'bottom'
2678
- }
2679
- ];
2680
- return result;
2681
- }
2682
2671
  const { visible = true, label, tick, title, grid, line, labelAutoHide, labelAutoHideGap, labelAutoLimit, labelAutoLimitLength = 80, labelAutoRotate, labelAutoRotateAngleRange } = config;
2683
2672
  const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit);
2684
2673
  const bandAxis = {
@@ -2760,6 +2749,12 @@
2760
2749
  if (!chunk_VCYTMP4D_n(numFormat)) return formatter(value);
2761
2750
  return String(value);
2762
2751
  };
2752
+ const createLinearPercentFormat = (value, autoFormat, numFormat, formatter, percentFormatter)=>{
2753
+ if (chunk_JK3VNB42_n(autoFormat) && chunk_VCYTMP4D_n(numFormat)) return percentFormatter(value);
2754
+ if (true === autoFormat) return percentFormatter(value);
2755
+ if (!chunk_VCYTMP4D_n(numFormat)) return formatter(value);
2756
+ return String(value);
2757
+ };
2763
2758
  const yLinear = (spec, context)=>{
2764
2759
  const result = {
2765
2760
  ...spec
@@ -2769,17 +2764,6 @@
2769
2764
  const { measures, dimensions, encoding } = advancedVSeed;
2770
2765
  const config = advancedVSeed.config?.[chartType]?.yAxis;
2771
2766
  if (!result.axes) result.axes = [];
2772
- if (!config) {
2773
- result.axes = [
2774
- ...result.axes,
2775
- {
2776
- visible: true,
2777
- type: 'linear',
2778
- orient: 'left'
2779
- }
2780
- ];
2781
- return result;
2782
- }
2783
2767
  const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, autoFormat, numFormat = {} } = config;
2784
2768
  const formatter = createNumFormatter(numFormat);
2785
2769
  const percentFormatter = createNumFormatter({
@@ -2798,7 +2782,7 @@
2798
2782
  label: {
2799
2783
  visible: label?.visible,
2800
2784
  formatMethod: (value)=>{
2801
- if ((isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) && chunk_VCYTMP4D_n(numFormat) && (true === autoFormat || chunk_JK3VNB42_n(autoFormat))) return percentFormatter(value);
2785
+ if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter);
2802
2786
  return createLinearFormat(value, autoFormat, numFormat, formatter);
2803
2787
  },
2804
2788
  style: {
@@ -5416,17 +5400,6 @@
5416
5400
  const { chartType } = vseed;
5417
5401
  const config = advancedVSeed.config?.[chartType]?.xAxis;
5418
5402
  if (!result.axes) result.axes = [];
5419
- if (!config) {
5420
- result.axes = [
5421
- ...result.axes,
5422
- {
5423
- visible: true,
5424
- type: 'linear',
5425
- orient: 'bottom'
5426
- }
5427
- ];
5428
- return result;
5429
- }
5430
5403
  const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, autoFormat, numFormat = {} } = config;
5431
5404
  const formatter = createNumFormatter(numFormat);
5432
5405
  const percentFormatter = createNumFormatter({
@@ -5445,7 +5418,7 @@
5445
5418
  label: {
5446
5419
  visible: label?.visible,
5447
5420
  formatMethod: (value)=>{
5448
- if (chunk_VCYTMP4D_n(numFormat) && (true === autoFormat || chunk_JK3VNB42_n(autoFormat)) && (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed))) return percentFormatter(value);
5421
+ if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter);
5449
5422
  return createLinearFormat(value, autoFormat, numFormat, formatter);
5450
5423
  },
5451
5424
  style: {
@@ -5505,17 +5478,6 @@
5505
5478
  const { measures, dimensions, encoding } = advancedVSeed;
5506
5479
  const config = advancedVSeed.config?.[chartType]?.yAxis;
5507
5480
  if (!result.axes) result.axes = [];
5508
- if (!config) {
5509
- result.axes = [
5510
- ...result.axes,
5511
- {
5512
- visible: true,
5513
- type: 'band',
5514
- orient: 'left'
5515
- }
5516
- ];
5517
- return result;
5518
- }
5519
5481
  const { visible = true, label, tick, title, grid, line, labelAutoHide, labelAutoHideGap, labelAutoLimit, labelAutoLimitLength = 80, labelAutoRotate, labelAutoRotateAngleRange } = config;
5520
5482
  const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit);
5521
5483
  const bandAxis = {
@@ -7479,19 +7441,6 @@
7479
7441
  ];
7480
7442
  const seriesId = alignTicksConfig ? seriesIds : seriesIds[0];
7481
7443
  if (!result.axes) result.axes = [];
7482
- if (!yAxisConfig) {
7483
- result.axes = [
7484
- ...result.axes,
7485
- {
7486
- visible: true,
7487
- id,
7488
- seriesId,
7489
- type: 'linear',
7490
- orient: 'left'
7491
- }
7492
- ];
7493
- return result;
7494
- }
7495
7444
  const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, autoFormat, numFormat = {} } = yAxisConfig;
7496
7445
  const formatter = createNumFormatter(numFormat);
7497
7446
  const linearAxis = {
@@ -7583,20 +7532,6 @@
7583
7532
  ];
7584
7533
  const seriesId = alignTicksConfig ? seriesIds : seriesIds[1];
7585
7534
  if (!result.axes) result.axes = [];
7586
- if (!yAxisConfig) {
7587
- result.axes = [
7588
- ...result.axes,
7589
- {
7590
- visible: true,
7591
- id,
7592
- seriesId,
7593
- type: 'linear',
7594
- orient: 'right',
7595
- sync
7596
- }
7597
- ];
7598
- return result;
7599
- }
7600
7535
  const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, numFormat = {}, autoFormat } = yAxisConfig;
7601
7536
  const formatter = createNumFormatter(numFormat);
7602
7537
  const linearAxis = {
@@ -8219,13 +8154,10 @@
8219
8154
  result.animation = true;
8220
8155
  return result;
8221
8156
  };
8222
- const radiusAxis = (spec, context)=>{
8157
+ const radiusAxis = (spec)=>{
8223
8158
  const result = {
8224
8159
  ...spec
8225
8160
  };
8226
- const { advancedVSeed } = context;
8227
- const { dimensions, measures } = advancedVSeed;
8228
- if (!dimensions || !measures) return result;
8229
8161
  if (!result.axes) result.axes = [];
8230
8162
  result.axes.push({
8231
8163
  type: 'linear',
@@ -8562,13 +8494,10 @@
8562
8494
  result.animation = true;
8563
8495
  return result;
8564
8496
  };
8565
- const radarAngleAxis = (spec, context)=>{
8497
+ const radarAngleAxis = (spec)=>{
8566
8498
  const result = {
8567
8499
  ...spec
8568
8500
  };
8569
- const { advancedVSeed } = context;
8570
- const { dimensions, measures } = advancedVSeed;
8571
- if (!dimensions || !measures) return result;
8572
8501
  if (!result.axes) result.axes = [];
8573
8502
  result.axes.push({
8574
8503
  orient: 'angle',
@@ -8587,13 +8516,10 @@
8587
8516
  });
8588
8517
  return result;
8589
8518
  };
8590
- const radarRadiusAxis = (spec, context)=>{
8519
+ const radarRadiusAxis = (spec)=>{
8591
8520
  const result = {
8592
8521
  ...spec
8593
8522
  };
8594
- const { advancedVSeed } = context;
8595
- const { dimensions, measures } = advancedVSeed;
8596
- if (!dimensions || !measures) return result;
8597
8523
  if (!result.axes) result.axes = [];
8598
8524
  result.axes.push({
8599
8525
  orient: 'radius',
@@ -8953,8 +8879,7 @@
8953
8879
  buildMeasures,
8954
8880
  deleteEncodingForMeasure([
8955
8881
  'tooltip',
8956
- 'label',
8957
- 'color'
8882
+ 'label'
8958
8883
  ]),
8959
8884
  deleteTooltipAndLabelDimension
8960
8885
  ]),