@visactor/vseed 0.1.13 → 0.1.15
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/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +3372 -108
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/{encodingAdapter.d.ts → adapter/encodingAdapter.d.ts} +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/{encodingAdapter.js → adapter/encodingAdapter.js} +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/adapter/encodingAdapter.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/adapter/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/adapter/index.js +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.d.ts +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js +13 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/index.js +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js +4 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js +2 -4
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +1 -3
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/angle.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/angle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js +9 -3
- package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js +9 -3
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js +8 -3
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js +8 -3
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/index.d.ts +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/index.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +5 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +59 -38
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js +15 -52
- package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/{labelColorInversion.d.ts → labelScatter.d.ts} +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js +19 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js +4 -4
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js +4 -4
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/series/series.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/series/series.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +13 -30
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +6 -6
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js +6 -18
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +6 -18
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js +8 -11
- package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js +8 -13
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js.map +1 -1
- package/dist/esm/pipeline/utils/constant.d.ts +1 -0
- package/dist/esm/pipeline/utils/constant.js +2 -1
- package/dist/esm/pipeline/utils/constant.js.map +1 -1
- package/dist/esm/pipeline/utils/format/createFormatter.d.ts +1 -1
- package/dist/esm/pipeline/utils/format/createFormatter.js +3 -2
- package/dist/esm/pipeline/utils/format/createFormatter.js.map +1 -1
- package/dist/esm/pipeline/utils/format/createFormatterByMeasure.d.ts +2 -0
- package/dist/esm/pipeline/utils/format/createFormatterByMeasure.js +13 -0
- package/dist/esm/pipeline/utils/format/createFormatterByMeasure.js.map +1 -0
- package/dist/esm/pipeline/utils/format/createNumFormatter.d.ts +1 -1
- package/dist/esm/pipeline/utils/format/createNumFormatter.js.map +1 -1
- package/dist/esm/pipeline/utils/format/index.d.ts +1 -0
- package/dist/esm/pipeline/utils/format/index.js +1 -0
- package/dist/esm/theme/dark.js +9 -3
- package/dist/esm/theme/dark.js.map +1 -1
- package/dist/esm/theme/light.js +27 -6
- package/dist/esm/theme/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +2334 -36
- package/dist/esm/types/chartType/area/zArea.d.ts +99 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +99 -1
- package/dist/esm/types/chartType/bar/zBar.d.ts +99 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +99 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +99 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +99 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +99 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +99 -1
- package/dist/esm/types/chartType/donut/zDonut.d.ts +69 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +309 -1
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +68 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +68 -0
- package/dist/esm/types/chartType/line/zLine.d.ts +99 -1
- package/dist/esm/types/chartType/pie/zPie.d.ts +69 -1
- package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +30 -0
- package/dist/esm/types/chartType/radar/zRadar.d.ts +69 -1
- package/dist/esm/types/chartType/rose/zRose.d.ts +69 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +69 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +249 -1
- package/dist/esm/types/chartType/table/zTable.d.ts +30 -0
- package/dist/esm/types/properties/config/axes/bandAxis.d.ts +146 -82
- package/dist/esm/types/properties/config/axes/bandAxis.js +0 -48
- package/dist/esm/types/properties/config/axes/index.d.ts +4 -3
- package/dist/esm/types/properties/config/axes/index.js +2 -3
- package/dist/esm/types/properties/config/axes/linearAxis.d.ts +149 -84
- package/dist/esm/types/properties/config/axes/linearAxis.js +0 -45
- package/dist/esm/types/properties/config/axes/zBandAxis.d.ts +79 -0
- package/dist/esm/types/properties/config/axes/{axis.js → zBandAxis.js} +5 -11
- package/dist/esm/types/properties/config/axes/zBandAxis.js.map +1 -0
- package/dist/esm/types/properties/config/axes/zLinearAxis.d.ts +141 -0
- package/dist/esm/types/properties/config/axes/zLinearAxis.js +47 -0
- package/dist/esm/types/properties/config/axes/zLinearAxis.js.map +1 -0
- package/dist/esm/types/properties/config/config.d.ts +2304 -37
- package/dist/esm/types/properties/config/config.js +1 -2
- package/dist/esm/types/properties/config/config.js.map +1 -1
- package/dist/esm/types/properties/config/label/label.d.ts +37 -0
- package/dist/esm/types/properties/config/label/zLabel.d.ts +38 -0
- package/dist/esm/types/properties/config/label/zLabel.js +11 -1
- package/dist/esm/types/properties/config/label/zLabel.js.map +1 -1
- package/dist/esm/types/properties/config/legend/legend.d.ts +6 -2
- package/dist/esm/types/properties/config/legend/legend.js +1 -1
- package/dist/esm/types/properties/config/legend/legend.js.map +1 -1
- package/dist/esm/types/properties/format/numFormat.js.map +1 -0
- package/dist/esm/types/properties/index.d.ts +1 -0
- package/dist/esm/types/properties/index.js +1 -0
- package/dist/esm/types/properties/measures/index.d.ts +0 -1
- package/dist/esm/types/properties/measures/index.js +0 -1
- package/dist/esm/types/properties/measures/measures.d.ts +6 -2
- package/dist/esm/types/properties/measures/zDualMeasures.d.ts +240 -0
- package/dist/esm/types/properties/measures/zMeasures.d.ts +90 -0
- package/dist/esm/types/properties/measures/zMeasures.js +2 -1
- package/dist/esm/types/properties/measures/zMeasures.js.map +1 -1
- package/dist/esm/types/properties/measures/zScatterMeasures.d.ts +240 -0
- package/dist/esm/types/properties/theme/customTheme.d.ts +2304 -36
- package/dist/esm/types/zVseed.d.ts +2090 -116
- package/dist/umd/index.js +270 -335
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/encodingAdapter.js.map +0 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelColorInversion.js +0 -13
- package/dist/esm/pipeline/spec/chart/pipes/label/labelColorInversion.js.map +0 -1
- package/dist/esm/types/properties/config/axes/axis.d.ts +0 -255
- package/dist/esm/types/properties/config/axes/axis.js.map +0 -1
- package/dist/esm/types/properties/config/axes/bandAxis.js.map +0 -1
- package/dist/esm/types/properties/config/axes/linearAxis.js.map +0 -1
- package/dist/esm/types/properties/measures/format/numFormat.js.map +0 -1
- /package/dist/esm/types/properties/{measures/format → format}/formatter.d.ts +0 -0
- /package/dist/esm/types/properties/{measures/format → format}/formatter.js +0 -0
- /package/dist/esm/types/properties/{measures/format → format}/index.d.ts +0 -0
- /package/dist/esm/types/properties/{measures/format → format}/index.js +0 -0
- /package/dist/esm/types/properties/{measures/format → format}/numFormat.d.ts +0 -0
- /package/dist/esm/types/properties/{measures/format → format}/numFormat.js +0 -0
@@ -1,6 +1,5 @@
|
|
1
1
|
import { z } from "zod";
|
2
|
-
import { zXBandAxis, zYBandAxis } from "./axes/
|
3
|
-
import { zXLinearAxis, zYLinearAxis } from "./axes/linearAxis.js";
|
2
|
+
import { zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis } from "./axes/index.js";
|
4
3
|
import { zCrosshairLine, zCrosshairRect } from "./crosshair/index.js";
|
5
4
|
import { zStackCornerRadius } from "./stackCornerRadius/stackCornerRadius.js";
|
6
5
|
import { zBackgroundColor } from "./backgroundColor/backgroundColor.js";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types/properties/config/config.js","sources":["webpack://@visactor/vseed/./src/types/properties/config/config.ts"],"sourcesContent":["import { z } from 'zod'\nimport { zXBandAxis, zYBandAxis } from './axes/bandAxis'\nimport { zXLinearAxis, zYLinearAxis } from './axes/linearAxis'\nimport { zCrosshairLine, zCrosshairRect } from './crosshair'\nimport { zStackCornerRadius } from './stackCornerRadius/stackCornerRadius'\nimport { zBackgroundColor } from './backgroundColor/backgroundColor'\nimport { zColor } from './color/color'\nimport { zLabel } from './label'\nimport { zLegend } from './legend/legend'\nimport { zTooltip } from './tooltip/tooltip'\nimport { zDualChartType } from '../chartType'\n\n/**\n * ---\n * zConfig by 图表类型\n */\nexport const zTableConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n\n // Border\n borderColor: z.string().nullish(),\n\n // Body\n bodyFontSize: z.number().nullish(),\n bodyFontColor: z.string().nullish(),\n bodyBackgroundColor: z.string().nullish(),\n // Body interaction\n hoverBodyBackgroundColor: z.string().nullish(),\n hoverBodyInlineBackgroundColor: z.string().nullish(),\n\n // Header\n headerFontSize: z.number().nullish(),\n headerFontColor: z.string().nullish(),\n headerBackgroundColor: z.string().nullish(),\n // Header interaction\n hoverHeaderBackgroundColor: z.string().nullish(),\n hoverHeaderInlineBackgroundColor: z.string().nullish(),\n\n // Interaction\n selectedBorderColor: z.string().nullish(),\n selectedBackgroundColor: z.string().nullish(),\n})\nexport const zPivotTableConfig = zTableConfig\n\nexport const zLineConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXBandAxis.nullish(),\n yAxis: zYLinearAxis.nullish(),\n crosshairLine: zCrosshairLine.nullish(),\n})\nexport const zColumnConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXBandAxis.nullish(),\n yAxis: zYLinearAxis.nullish(),\n crosshairRect: zCrosshairRect.nullish(),\n stackCornerRadius: zStackCornerRadius.nullish(),\n})\nexport const zColumnParallelConfig = zColumnConfig\nexport const zColumnPercentConfig = zColumnConfig\nexport const zBarConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXLinearAxis.nullish(),\n yAxis: zYBandAxis.nullish(),\n crosshairRect: zCrosshairRect.nullish(),\n stackCornerRadius: zStackCornerRadius.nullish(),\n})\nexport const zBarParallelConfig = zBarConfig\nexport const zBarPercentConfig = zBarConfig\nexport const zAreaConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXBandAxis.nullish(),\n yAxis: zYLinearAxis.nullish(),\n crosshairLine: zCrosshairLine.nullish(),\n})\nexport const zAreaPercentConfig = zAreaConfig\n\nexport const zDualAxisConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n dualChartType: z.array(zDualChartType).or(zDualChartType).nullish(),\n alignTicks: z.array(z.boolean()).or(z.boolean()).nullish(),\n primaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).nullish(),\n secondaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).nullish(),\n\n xAxis: zXBandAxis.nullish(),\n crosshairRect: zCrosshairRect.nullish(),\n})\nexport const zScatterConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXLinearAxis.nullish(),\n yAxis: zYLinearAxis.nullish(),\n crosshairLine: zCrosshairLine.nullish(),\n})\n\n// polar\nexport const zRoseConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n})\nexport const zRoseParallelConfig = zRoseConfig\nexport const zPieConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n})\nexport const zDonutConfig = zPieConfig\nexport const zRadarConfig = zPieConfig\n// other\nexport const zFunnelConfig = zPieConfig\nexport const zHeatmapConfig = zPieConfig\n\n/**\n * ---\n * Type config by chart type\n */\nexport type TableConfig = z.infer<typeof zTableConfig>\nexport type PivotTableConfig = z.infer<typeof zPivotTableConfig>\n// cartesian\nexport type LineConfig = z.infer<typeof zLineConfig>\nexport type ColumnConfig = z.infer<typeof zColumnConfig>\nexport type ColumnParallelConfig = z.infer<typeof zColumnParallelConfig>\nexport type ColumnPercentConfig = z.infer<typeof zColumnPercentConfig>\nexport type BarConfig = z.infer<typeof zBarConfig>\nexport type BarParallelConfig = z.infer<typeof zBarParallelConfig>\nexport type BarPercentConfig = z.infer<typeof zBarPercentConfig>\nexport type AreaConfig = z.infer<typeof zAreaConfig>\nexport type AreaPercentConfig = z.infer<typeof zAreaPercentConfig>\n\nexport type ScatterConfig = z.infer<typeof zScatterConfig>\nexport type DualAxisConfig = z.infer<typeof zDualAxisConfig>\n// polar\nexport type RoseConfig = z.infer<typeof zRoseConfig>\nexport type RoseParallelConfig = z.infer<typeof zRoseParallelConfig>\nexport type PieConfig = z.infer<typeof zPieConfig>\nexport type DonutConfig = z.infer<typeof zDonutConfig>\nexport type RadarConfig = z.infer<typeof zRadarConfig>\n// other\nexport type FunnelConfig = z.infer<typeof zFunnelConfig>\nexport type HeatmapConfig = z.infer<typeof zHeatmapConfig>\n\n/**\n * config and type\n */\nexport type Config = z.infer<typeof zConfig>\nexport const zConfig = z.object({\n table: zTableConfig.nullish(),\n pivotTable: zPivotTableConfig.nullish(),\n\n // cartesian\n line: zLineConfig.nullish(),\n column: zColumnConfig.nullish(),\n columnParallel: zColumnParallelConfig.nullish(),\n columnPercent: zColumnPercentConfig.nullish(),\n bar: zBarConfig.nullish(),\n barParallel: zBarParallelConfig.nullish(),\n barPercent: zBarPercentConfig.nullish(),\n area: zAreaConfig.nullish(),\n areaPercent: zAreaPercentConfig.nullish(),\n\n scatter: zScatterConfig.nullish(),\n dualAxis: zDualAxisConfig.nullish(),\n\n // polar\n rose: zRoseConfig.nullish(),\n roseParallel: zRoseParallelConfig.nullish(),\n pie: zPieConfig.nullish(),\n donut: zDonutConfig.nullish(),\n radar: zRadarConfig.nullish(),\n // other\n funnel: zFunnelConfig.nullish(),\n heatmap: zHeatmapConfig.nullish(),\n})\n"],"names":["zTableConfig","z","zBackgroundColor","zPivotTableConfig","zLineConfig","zLabel","zColor","zTooltip","zLegend","zXBandAxis","zYLinearAxis","zCrosshairLine","zColumnConfig","zCrosshairRect","zStackCornerRadius","zColumnParallelConfig","zColumnPercentConfig","zBarConfig","zXLinearAxis","zYBandAxis","zBarParallelConfig","zBarPercentConfig","zAreaConfig","zAreaPercentConfig","zDualAxisConfig","zDualChartType","zScatterConfig","zRoseConfig","zRoseParallelConfig","zPieConfig","zDonutConfig","zRadarConfig","zFunnelConfig","zHeatmapConfig","zConfig"],"mappings":";;;;;;;;;;;AAgBO,MAAMA,eAAeC,EAAE,MAAM,CAAC;IACnC,iBAAiBC,iBAAiB,OAAO;IAGzC,aAAaD,EAAE,MAAM,GAAG,OAAO;IAG/B,cAAcA,EAAE,MAAM,GAAG,OAAO;IAChC,eAAeA,EAAE,MAAM,GAAG,OAAO;IACjC,qBAAqBA,EAAE,MAAM,GAAG,OAAO;IAEvC,0BAA0BA,EAAE,MAAM,GAAG,OAAO;IAC5C,gCAAgCA,EAAE,MAAM,GAAG,OAAO;IAGlD,gBAAgBA,EAAE,MAAM,GAAG,OAAO;IAClC,iBAAiBA,EAAE,MAAM,GAAG,OAAO;IACnC,uBAAuBA,EAAE,MAAM,GAAG,OAAO;IAEzC,4BAA4BA,EAAE,MAAM,GAAG,OAAO;IAC9C,kCAAkCA,EAAE,MAAM,GAAG,OAAO;IAGpD,qBAAqBA,EAAE,MAAM,GAAG,OAAO;IACvC,yBAAyBA,EAAE,MAAM,GAAG,OAAO;AAC7C;AACO,MAAME,oBAAoBH;AAE1B,MAAMI,cAAcH,EAAE,MAAM,CAAC;IAClC,iBAAiBC,iBAAiB,OAAO;IACzC,OAAOG,OAAO,OAAO;IACrB,OAAOC,OAAO,OAAO;IACrB,SAASC,SAAS,OAAO;IACzB,QAAQC,QAAQ,OAAO;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qB,OAAO;IAC3C,KAAKC,WAAW,OAAO;IACvB,aAAaG,mBAAmB,OAAO;IACvC,YAAYC,kBAAkB,OAAO;IACrC,MAAMC,YAAY,OAAO;IACzB,aAAaC,mBAAmB,OAAO;IAEvC,SAASG,eAAe,OAAO;IAC/B,UAAUF,gBAAgB,OAAO;IAGjC,MAAMG,YAAY,OAAO;IACzB,cAAcC,oBAAoB,OAAO;IACzC,KAAKC,WAAW,OAAO;IACvB,OAAOC,aAAa,OAAO;IAC3B,OAAOC,aAAa,OAAO;IAE3B,QAAQC,cAAc,OAAO;IAC7B,SAASC,eAAe,OAAO;AACjC"}
|
1
|
+
{"version":3,"file":"types/properties/config/config.js","sources":["webpack://@visactor/vseed/./src/types/properties/config/config.ts"],"sourcesContent":["import { z } from 'zod'\nimport { zXBandAxis, zYBandAxis, zXLinearAxis, zYLinearAxis } from './axes'\nimport { zCrosshairLine, zCrosshairRect } from './crosshair'\nimport { zStackCornerRadius } from './stackCornerRadius/stackCornerRadius'\nimport { zBackgroundColor } from './backgroundColor/backgroundColor'\nimport { zColor } from './color/color'\nimport { zLabel } from './label'\nimport { zLegend } from './legend/legend'\nimport { zTooltip } from './tooltip/tooltip'\nimport { zDualChartType } from '../chartType'\n\n/**\n * zConfig by 图表类型\n */\nexport const zTableConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n\n // Border\n borderColor: z.string().nullish(),\n\n // Body\n bodyFontSize: z.number().nullish(),\n bodyFontColor: z.string().nullish(),\n bodyBackgroundColor: z.string().nullish(),\n // Body interaction\n hoverBodyBackgroundColor: z.string().nullish(),\n hoverBodyInlineBackgroundColor: z.string().nullish(),\n\n // Header\n headerFontSize: z.number().nullish(),\n headerFontColor: z.string().nullish(),\n headerBackgroundColor: z.string().nullish(),\n // Header interaction\n hoverHeaderBackgroundColor: z.string().nullish(),\n hoverHeaderInlineBackgroundColor: z.string().nullish(),\n\n // Interaction\n selectedBorderColor: z.string().nullish(),\n selectedBackgroundColor: z.string().nullish(),\n})\nexport const zPivotTableConfig = zTableConfig\n\nexport const zLineConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXBandAxis.nullish(),\n yAxis: zYLinearAxis.nullish(),\n crosshairLine: zCrosshairLine.nullish(),\n})\nexport const zColumnConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXBandAxis.nullish(),\n yAxis: zYLinearAxis.nullish(),\n crosshairRect: zCrosshairRect.nullish(),\n stackCornerRadius: zStackCornerRadius.nullish(),\n})\nexport const zColumnParallelConfig = zColumnConfig\nexport const zColumnPercentConfig = zColumnConfig\nexport const zBarConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXLinearAxis.nullish(),\n yAxis: zYBandAxis.nullish(),\n crosshairRect: zCrosshairRect.nullish(),\n stackCornerRadius: zStackCornerRadius.nullish(),\n})\nexport const zBarParallelConfig = zBarConfig\nexport const zBarPercentConfig = zBarConfig\nexport const zAreaConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXBandAxis.nullish(),\n yAxis: zYLinearAxis.nullish(),\n crosshairLine: zCrosshairLine.nullish(),\n})\nexport const zAreaPercentConfig = zAreaConfig\n\nexport const zDualAxisConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n dualChartType: z.array(zDualChartType).or(zDualChartType).nullish(),\n alignTicks: z.array(z.boolean()).or(z.boolean()).nullish(),\n primaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).nullish(),\n secondaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).nullish(),\n\n xAxis: zXBandAxis.nullish(),\n crosshairRect: zCrosshairRect.nullish(),\n})\nexport const zScatterConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n\n xAxis: zXLinearAxis.nullish(),\n yAxis: zYLinearAxis.nullish(),\n crosshairLine: zCrosshairLine.nullish(),\n})\n\n// polar\nexport const zRoseConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n})\nexport const zRoseParallelConfig = zRoseConfig\nexport const zPieConfig = z.object({\n backgroundColor: zBackgroundColor.nullish(),\n label: zLabel.nullish(),\n color: zColor.nullish(),\n tooltip: zTooltip.nullish(),\n legend: zLegend.nullish(),\n})\nexport const zDonutConfig = zPieConfig\nexport const zRadarConfig = zPieConfig\n// other\nexport const zFunnelConfig = zPieConfig\nexport const zHeatmapConfig = zPieConfig\n\n/**\n * ---\n * Type config by chart type\n */\nexport type TableConfig = z.infer<typeof zTableConfig>\nexport type PivotTableConfig = z.infer<typeof zPivotTableConfig>\n// cartesian\nexport type LineConfig = z.infer<typeof zLineConfig>\nexport type ColumnConfig = z.infer<typeof zColumnConfig>\nexport type ColumnParallelConfig = z.infer<typeof zColumnParallelConfig>\nexport type ColumnPercentConfig = z.infer<typeof zColumnPercentConfig>\nexport type BarConfig = z.infer<typeof zBarConfig>\nexport type BarParallelConfig = z.infer<typeof zBarParallelConfig>\nexport type BarPercentConfig = z.infer<typeof zBarPercentConfig>\nexport type AreaConfig = z.infer<typeof zAreaConfig>\nexport type AreaPercentConfig = z.infer<typeof zAreaPercentConfig>\n\nexport type ScatterConfig = z.infer<typeof zScatterConfig>\nexport type DualAxisConfig = z.infer<typeof zDualAxisConfig>\n// polar\nexport type RoseConfig = z.infer<typeof zRoseConfig>\nexport type RoseParallelConfig = z.infer<typeof zRoseParallelConfig>\nexport type PieConfig = z.infer<typeof zPieConfig>\nexport type DonutConfig = z.infer<typeof zDonutConfig>\nexport type RadarConfig = z.infer<typeof zRadarConfig>\n// other\nexport type FunnelConfig = z.infer<typeof zFunnelConfig>\nexport type HeatmapConfig = z.infer<typeof zHeatmapConfig>\n\n/**\n * config and type\n */\nexport type Config = z.infer<typeof zConfig>\nexport const zConfig = z.object({\n table: zTableConfig.nullish(),\n pivotTable: zPivotTableConfig.nullish(),\n\n // cartesian\n line: zLineConfig.nullish(),\n column: zColumnConfig.nullish(),\n columnParallel: zColumnParallelConfig.nullish(),\n columnPercent: zColumnPercentConfig.nullish(),\n bar: zBarConfig.nullish(),\n barParallel: zBarParallelConfig.nullish(),\n barPercent: zBarPercentConfig.nullish(),\n area: zAreaConfig.nullish(),\n areaPercent: zAreaPercentConfig.nullish(),\n\n scatter: zScatterConfig.nullish(),\n dualAxis: zDualAxisConfig.nullish(),\n\n // polar\n rose: zRoseConfig.nullish(),\n roseParallel: zRoseParallelConfig.nullish(),\n pie: zPieConfig.nullish(),\n donut: zDonutConfig.nullish(),\n radar: zRadarConfig.nullish(),\n // other\n funnel: zFunnelConfig.nullish(),\n heatmap: zHeatmapConfig.nullish(),\n})\n"],"names":["zTableConfig","z","zBackgroundColor","zPivotTableConfig","zLineConfig","zLabel","zColor","zTooltip","zLegend","zXBandAxis","zYLinearAxis","zCrosshairLine","zColumnConfig","zCrosshairRect","zStackCornerRadius","zColumnParallelConfig","zColumnPercentConfig","zBarConfig","zXLinearAxis","zYBandAxis","zBarParallelConfig","zBarPercentConfig","zAreaConfig","zAreaPercentConfig","zDualAxisConfig","zDualChartType","zScatterConfig","zRoseConfig","zRoseParallelConfig","zPieConfig","zDonutConfig","zRadarConfig","zFunnelConfig","zHeatmapConfig","zConfig"],"mappings":";;;;;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';
|
1
2
|
export type Label = {
|
2
3
|
/**
|
3
4
|
* @description 标签功能是否开启
|
@@ -17,4 +18,40 @@ export type Label = {
|
|
17
18
|
* 多指标的场景, 无需担心多个指标的值会矛盾, 因为所有的绘图相关的指标, 都会经过`foldMeasures`处理, 合并为一个指标, 代表一个数据点, 所以不会矛盾
|
18
19
|
*/
|
19
20
|
showValuePercent?: boolean;
|
21
|
+
/**
|
22
|
+
* @description 标签数值是否自动格式化, 当配置了 numFormat 时, 该配置项失效
|
23
|
+
*/
|
24
|
+
autoFormat?: boolean;
|
25
|
+
/**
|
26
|
+
* @description 标签数值格式化配置, 会和 `measure` 中的 `format` 进行合并, `measure` 中的 `format` 优先级更高.
|
27
|
+
*/
|
28
|
+
numFormat?: NumFormat;
|
29
|
+
/**
|
30
|
+
* @description 标签字体大小
|
31
|
+
*/
|
32
|
+
labelFontSize?: number;
|
33
|
+
/**
|
34
|
+
* @description 标签字体粗细
|
35
|
+
*/
|
36
|
+
labelFontWeight?: number | string;
|
37
|
+
/**
|
38
|
+
* @description 标签背景色
|
39
|
+
*/
|
40
|
+
labelBackgroundColor?: string;
|
41
|
+
/**
|
42
|
+
* @description 标签字体颜色
|
43
|
+
*/
|
44
|
+
labelColor?: string;
|
45
|
+
/**
|
46
|
+
* @description 标签是否自动根据图元颜色进行字体颜色的反转
|
47
|
+
*/
|
48
|
+
labelColorSmartInvert?: boolean;
|
49
|
+
/**
|
50
|
+
* @description 标签位置
|
51
|
+
*/
|
52
|
+
labelPosition?: 'inside' | 'outside';
|
53
|
+
/**
|
54
|
+
* @description 标签防重叠功能是否启用
|
55
|
+
*/
|
56
|
+
labelOverlap?: boolean;
|
20
57
|
};
|
@@ -4,4 +4,42 @@ export declare const zLabel: z.ZodObject<{
|
|
4
4
|
wrap: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
5
5
|
showValue: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
6
6
|
showValuePercent: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
7
|
+
autoFormat: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
8
|
+
numFormat: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
9
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
10
|
+
number: "number";
|
11
|
+
percent: "percent";
|
12
|
+
permille: "permille";
|
13
|
+
scientific: "scientific";
|
14
|
+
}>>>;
|
15
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
16
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
17
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
18
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
19
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
20
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
21
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
22
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
23
|
+
morePrecision: "morePrecision";
|
24
|
+
lessPrecision: "lessPrecision";
|
25
|
+
}>>>;
|
26
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
27
|
+
floor: "floor";
|
28
|
+
ceil: "ceil";
|
29
|
+
expand: "expand";
|
30
|
+
trunc: "trunc";
|
31
|
+
halfCeil: "halfCeil";
|
32
|
+
halfFloor: "halfFloor";
|
33
|
+
halfExpand: "halfExpand";
|
34
|
+
halfTrunc: "halfTrunc";
|
35
|
+
halfEven: "halfEven";
|
36
|
+
}>>>;
|
37
|
+
}, z.core.$strip>>>>;
|
38
|
+
labelFontSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
39
|
+
labelFontWeight: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodString]>>>;
|
40
|
+
labelBackgroundColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
41
|
+
labelColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
42
|
+
labelColorSmartInvert: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
43
|
+
labelPosition: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
44
|
+
labelOverlap: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
7
45
|
}, z.core.$strip>;
|
@@ -1,9 +1,19 @@
|
|
1
1
|
import { z } from "zod";
|
2
|
+
import { zNumFormat } from "../../format/index.js";
|
2
3
|
const zLabel = z.object({
|
3
4
|
enable: z.boolean().nullish(),
|
4
5
|
wrap: z.boolean().nullish(),
|
5
6
|
showValue: z.boolean().nullish(),
|
6
|
-
showValuePercent: z.boolean().nullish()
|
7
|
+
showValuePercent: z.boolean().nullish(),
|
8
|
+
autoFormat: z.boolean().nullish(),
|
9
|
+
numFormat: zNumFormat.nullish(),
|
10
|
+
labelFontSize: z.number().nullish(),
|
11
|
+
labelFontWeight: z.number().or(z.string()).nullish(),
|
12
|
+
labelBackgroundColor: z.string().nullish(),
|
13
|
+
labelColor: z.string().nullish(),
|
14
|
+
labelColorSmartInvert: z.boolean().nullish(),
|
15
|
+
labelPosition: z.string().nullish(),
|
16
|
+
labelOverlap: z.boolean().nullish()
|
7
17
|
});
|
8
18
|
export { zLabel };
|
9
19
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types/properties/config/label/zLabel.js","sources":["webpack://@visactor/vseed/./src/types/properties/config/label/zLabel.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const zLabel = z.object({\n enable: z.boolean().nullish(),\n wrap: z.boolean().nullish(),\n showValue: z.boolean().nullish(),\n showValuePercent: z.boolean().nullish(),\n})\n"],"names":["zLabel","z"],"mappings":"
|
1
|
+
{"version":3,"file":"types/properties/config/label/zLabel.js","sources":["webpack://@visactor/vseed/./src/types/properties/config/label/zLabel.ts"],"sourcesContent":["import { z } from 'zod'\nimport { zNumFormat } from '../../format'\n\nexport const zLabel = z.object({\n enable: z.boolean().nullish(),\n wrap: z.boolean().nullish(),\n showValue: z.boolean().nullish(),\n showValuePercent: z.boolean().nullish(),\n autoFormat: z.boolean().nullish(),\n numFormat: zNumFormat.nullish(),\n labelFontSize: z.number().nullish(),\n labelFontWeight: z.number().or(z.string()).nullish(),\n labelBackgroundColor: z.string().nullish(),\n labelColor: z.string().nullish(),\n labelColorSmartInvert: z.boolean().nullish(),\n labelPosition: z.string().nullish(),\n labelOverlap: z.boolean().nullish(),\n})\n"],"names":["zLabel","z","zNumFormat"],"mappings":";;AAGO,MAAMA,SAASC,EAAE,MAAM,CAAC;IAC7B,QAAQA,EAAE,OAAO,GAAG,OAAO;IAC3B,MAAMA,EAAE,OAAO,GAAG,OAAO;IACzB,WAAWA,EAAE,OAAO,GAAG,OAAO;IAC9B,kBAAkBA,EAAE,OAAO,GAAG,OAAO;IACrC,YAAYA,EAAE,OAAO,GAAG,OAAO;IAC/B,WAAWC,WAAW,OAAO;IAC7B,eAAeD,EAAE,MAAM,GAAG,OAAO;IACjC,iBAAiBA,EAAE,MAAM,GAAG,EAAE,CAACA,EAAE,MAAM,IAAI,OAAO;IAClD,sBAAsBA,EAAE,MAAM,GAAG,OAAO;IACxC,YAAYA,EAAE,MAAM,GAAG,OAAO;IAC9B,uBAAuBA,EAAE,OAAO,GAAG,OAAO;IAC1C,eAAeA,EAAE,MAAM,GAAG,OAAO;IACjC,cAAcA,EAAE,OAAO,GAAG,OAAO;AACnC"}
|
@@ -13,6 +13,10 @@ export type Legend = {
|
|
13
13
|
* @example border: true
|
14
14
|
*/
|
15
15
|
border?: boolean;
|
16
|
+
/**
|
17
|
+
* @description 图例字体颜色
|
18
|
+
*/
|
19
|
+
labelColor?: string;
|
16
20
|
/**
|
17
21
|
* @description 图例字体大小
|
18
22
|
* @example labelFontSize: 10
|
@@ -20,7 +24,7 @@ export type Legend = {
|
|
20
24
|
labelFontSize?: number;
|
21
25
|
/**
|
22
26
|
* @description 图例字体颜色
|
23
|
-
* @
|
27
|
+
* @deprecated use labelColor instead
|
24
28
|
*/
|
25
29
|
labelFontColor?: string;
|
26
30
|
/**
|
@@ -101,8 +105,8 @@ export declare const zLegend: z.ZodObject<{
|
|
101
105
|
bl: "bl";
|
102
106
|
br: "br";
|
103
107
|
}>>>>;
|
108
|
+
labelColor: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>;
|
104
109
|
labelFontSize: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNumber>>>;
|
105
|
-
labelFontColor: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>;
|
106
110
|
labelFontWeight: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>>>;
|
107
111
|
}, z.core.$strip>;
|
108
112
|
export type ColorLegend = Pick<Legend, 'position' | 'enable'>;
|
@@ -49,8 +49,8 @@ const zLegend = z.object({
|
|
49
49
|
'bl',
|
50
50
|
'br'
|
51
51
|
]).default('bottom').nullish(),
|
52
|
+
labelColor: z.string().default('#fff').nullish(),
|
52
53
|
labelFontSize: z.number().default(12).nullish(),
|
53
|
-
labelFontColor: z.string().default('#fff').nullish(),
|
54
54
|
labelFontWeight: z.number().or(z.string()).default(400).nullish()
|
55
55
|
});
|
56
56
|
const zColorLegend = z.object({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types/properties/config/legend/legend.js","sources":["webpack://@visactor/vseed/./src/types/properties/config/legend/legend.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport type Legend = {\n /**\n * 图例功能是否开启\n * @default true\n * @example enable: true\n */\n enable?: boolean\n /**\n * @description 图例边框是否开启\n * @warning 仅离散图例生效\n * @default true\n * @example border: true\n */\n border?: boolean\n /**\n * @description 图例字体大小\n * @example labelFontSize: 10\n */\n labelFontSize?: number\n /**\n * @description 图例字体颜色\n * @
|
1
|
+
{"version":3,"file":"types/properties/config/legend/legend.js","sources":["webpack://@visactor/vseed/./src/types/properties/config/legend/legend.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport type Legend = {\n /**\n * 图例功能是否开启\n * @default true\n * @example enable: true\n */\n enable?: boolean\n /**\n * @description 图例边框是否开启\n * @warning 仅离散图例生效\n * @default true\n * @example border: true\n */\n border?: boolean\n\n /**\n * @description 图例字体颜色\n */\n labelColor?: string\n\n /**\n * @description 图例字体大小\n * @example labelFontSize: 10\n */\n labelFontSize?: number\n\n /**\n * @description 图例字体颜色\n * @deprecated use labelColor instead\n */\n labelFontColor?: string\n\n /**\n * @description 图例字体粗细\n * @example labelFontWeight: 400\n */\n labelFontWeight?: number | string\n /**\n * @description 图例形状\n * @warning 仅离散图例生效\n * @example shapeType: 'circle'\n */\n shapeType?:\n | 'circle'\n | 'cross'\n | 'diamond'\n | 'square'\n | 'arrow'\n | 'arrow2Left'\n | 'arrow2Right'\n | 'wedge'\n | 'thinTriangle'\n | 'triangle'\n | 'triangleUp'\n | 'triangleDown'\n | 'triangleRight'\n | 'triangleLeft'\n | 'stroke'\n | 'star'\n | 'wye'\n | 'rect'\n | 'arrowLeft'\n | 'arrowRight'\n | 'rectRound'\n | 'roundLine'\n /**\n * 图例位置\n * @default 'right'\n * @example position: 'rightTop'\n */\n position?:\n | 'left'\n | 'leftTop'\n | 'leftBottom'\n | 'lt'\n | 'lb'\n | 'top'\n | 'topLeft'\n | 'topRight'\n | 'tl'\n | 'tr'\n | 'right'\n | 'rightTop'\n | 'rightBottom'\n | 'rt'\n | 'rb'\n | 'bottom'\n | 'bottomLeft'\n | 'bottomRight'\n | 'bl'\n | 'br'\n\n /**\n * @description 存在大量图例时, 最大列数 或 图例最大行数\n * 如果position为水平方向(bottom, bottomLeft, bottomRight, bl, br, top, topLeft, topRight, tl, tr), maxSize控制显示的列数\n * 如果position为垂直方向(left, leftTop, leftBottom, lt, lb, right, rightTop, rightBottom, rt, rb), maxSize控制显示的行数\n *\n * @warning 仅离散图例生效\n * @example maxSize: 2\n * @default 1\n */\n maxSize?: number\n}\n\nexport const zLegend = z.object({\n enable: z.boolean().default(true).nullish(),\n border: z.boolean().default(true).nullish(),\n maxSize: z.number().default(1).nullish(),\n shapeType: z\n .enum([\n 'circle',\n 'cross',\n 'diamond',\n 'square',\n 'arrow',\n 'arrow2Left',\n 'arrow2Right',\n 'wedge',\n 'thinTriangle',\n 'triangle',\n 'triangleUp',\n 'triangleDown',\n 'triangleRight',\n 'triangleLeft',\n 'stroke',\n 'star',\n 'wye',\n 'rect',\n 'arrowLeft',\n 'arrowRight',\n 'rectRound',\n 'roundLine',\n ])\n .default('rectRound')\n .nullish(),\n position: z\n .enum([\n 'left',\n 'leftTop',\n 'leftBottom',\n 'lt',\n 'lb',\n 'top',\n 'topLeft',\n 'topRight',\n 'tl',\n 'tr',\n 'right',\n 'rightTop',\n 'rightBottom',\n 'rt',\n 'rb',\n 'bottom',\n 'bottomLeft',\n 'bottomRight',\n 'bl',\n 'br',\n ])\n .default('bottom')\n .nullish(),\n labelColor: z.string().default('#fff').nullish(),\n labelFontSize: z.number().default(12).nullish(),\n labelFontWeight: z.number().or(z.string()).default(400).nullish(),\n})\n\nexport type ColorLegend = Pick<Legend, 'position' | 'enable'>\nexport const zColorLegend = z.object({\n position: z\n .enum([\n 'left',\n 'leftTop',\n 'leftBottom',\n 'lt',\n 'lb',\n 'top',\n 'topLeft',\n 'topRight',\n 'tl',\n 'tr',\n 'right',\n 'rightTop',\n 'rightBottom',\n 'rt',\n 'rb',\n 'bottom',\n 'bottomLeft',\n 'bottomRight',\n 'bl',\n 'br',\n ])\n .default('bottom')\n .nullish(),\n enable: z.boolean().default(true).nullish(),\n})\n"],"names":["zLegend","z","zColorLegend"],"mappings":";AA0GO,MAAMA,UAAUC,EAAE,MAAM,CAAC;IAC9B,QAAQA,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,OAAO;IACzC,QAAQA,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,OAAO;IACzC,SAASA,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,OAAO;IACtC,WAAWA,CAAC,CAADA,OACJ,CAAC;QACJ;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,EACA,OAAO,CAAC,aACR,OAAO;IACV,UAAUA,CAAC,CAADA,OACH,CAAC;QACJ;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,EACA,OAAO,CAAC,UACR,OAAO;IACV,YAAYA,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,OAAO;IAC9C,eAAeA,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,OAAO;IAC7C,iBAAiBA,EAAE,MAAM,GAAG,EAAE,CAACA,EAAE,MAAM,IAAI,OAAO,CAAC,KAAK,OAAO;AACjE;AAGO,MAAMC,eAAeD,EAAE,MAAM,CAAC;IACnC,UAAUA,CAAC,CAADA,OACH,CAAC;QACJ;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,EACA,OAAO,CAAC,UACR,OAAO;IACV,QAAQA,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,OAAO;AAC3C"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types/properties/format/numFormat.js","sources":["webpack://@visactor/vseed/./src/types/properties/format/numFormat.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport interface NumFormat {\n /**\n * @description 数字格式化类型, 支持数值(十进制)、百分比(%)、千分比(‰)、科学计数法\n * @default 'number'\n */\n type?: 'number' | 'percent' | 'permille' | 'scientific'\n\n /**\n * @description 数值格式化比例, 百分比和千分比需要设置比例\n * @default 1\n * @example\n * - 100000 转换为 10万, ratio:10000, symbol:\"万\"\n * - 100000 转换为 10K, ratio:1000, symbol:\"K\"\n * - 100000 转换为 100%, ratio:100, symbol:\"%\"\n * - 100000 转换为 100‰, ratio:1000, symbol:\"‰\"\n */\n ratio?: number\n\n /**\n * @description 数值格式化符号, 例如%、‰\n * @default ''\n * @example\n * - 100000 转换为 10万, ratio:10000, symbol:\"万\"\n * - 100000 转换为 10K, ratio:1000, symbol:\"K\"\n * - 100000 转换为 100%, ratio:100, symbol:\"%\"\n * - 100000 转换为 100‰, ratio:1000, symbol:\"‰\"\n */\n symbol?: string\n\n /**\n * @description 数值格式化千分位分隔符\n * @default true\n */\n thousandSeparator?: boolean\n\n /**\n * @description 数值格式化后缀\n * @default ''\n */\n suffix?: string\n /**\n * @description 数值格式化前缀\n * @default ''\n */\n prefix?: string\n\n /**\n * @description 数值格式化小数位, 使用浏览器提供的 Intl.NumberFormat 中的 minimumFractionDigits 和 maximumFractionDigits 进行格式化, 优先级低于 significantDigits\n * @default 2\n * @example\n * - 1234.5678 转换为 1235, fractionDigits:0 (roundingMode:halfCeil)\n * - 1234.5678 转换为 1234.6, fractionDigits:1 (roundingMode:halfCeil)\n * - 1234.5678 转换为 1234.57, fractionDigits:2 (roundingMode:halfCeil)\n * - 1234.5678 转换为 1230.568, fractionDigits:3 (roundingMode:halfCeil)\n * - 1234.5678 转换为 1234.5678, fractionDigits:4 (roundingMode:halfCeil)\n * - 1234.5678 转换为 1234.56780, fractionDigits:5 (roundingMode:halfCeil)\n */\n fractionDigits?: number\n\n /**\n * @description 数值格式化有效位, 使用浏览器提供的 Intl.NumberFormat 中的 minimumSignificantDigits 和 maximumSignificantDigits 进行格式化, 优先级高于 fractionDigits\n * @default undefined\n * @example\n * - 1234.5678 转换为 1000, significantDigits:1\n * - 1234.5678 转换为 1200, significantDigits:2\n * - 1234.5678 转换为 1230, significantDigits:3\n * - 1234.5678 转换为 1234, significantDigits:4\n * - 1234.5678 转换为 1234.6, significantDigits:5 (roundingMode:halfCeil)\n * - 1234.5678 转换为 1234.57, significantDigits:6 (roundingMode:halfCeil)\n * - 1234.5678 转换为 1234.568, significantDigits:7 (roundingMode:halfCeil)\n * - 1234.5678 转换为 1234.5678, significantDigits:8 (roundingMode:halfCeil)\n */\n significantDigits?: number\n\n /**\n * @description 数值格式化舍入优先级, 处理同时设置了 significantDigits 和 fractionDigits 时的舍入优先级, 使用浏览器提供的 Intl.NumberFormat 进行格式化, 规则同 Intl.NumberFormat 中的 roundingPriority\n * @default 'morePrecision'\n * @example\n * - 1234.5678 转换为 1230, significantDigits:3 (roundingPriority:lessPrecision)\n * - 1234.5678 转换为 1234.5678, significantDigits:3 (roundingPriority:morePrecision)\n */\n roundingPriority?: 'morePrecision' | 'lessPrecision'\n\n /**\n * @description 数值格式化舍入模式, 使用浏览器提供的 Intl.NumberFormat 进行格式化, 规则同 Intl.NumberFormat 中的 roundingMode\n * @default 'halfExpand'\n * @example\n */\n roundingMode?:\n | 'floor'\n | 'ceil'\n | 'expand'\n | 'trunc'\n | 'halfCeil'\n | 'halfFloor'\n | 'halfExpand'\n | 'halfTrunc'\n | 'halfEven'\n}\n\nexport const zNumFormat = z\n .object({\n type: z.enum(['number', 'percent', 'permille', 'scientific']).default('number').optional(),\n ratio: z.number().default(1).optional(),\n symbol: z.string().default('').optional(),\n thousandSeparator: z.boolean().default(false).optional(),\n prefix: z.string().default('').optional(),\n suffix: z.string().default('').optional(),\n\n fractionDigits: z.number().default(2).optional(),\n significantDigits: z.number().default(0).optional(),\n roundingPriority: z.enum(['morePrecision', 'lessPrecision']).default('morePrecision').optional(),\n roundingMode: z\n .enum(['floor', 'ceil', 'halfEven', 'expand', 'trunc', 'halfFloor', 'halfCeil', 'halfExpand', 'halfTrunc'])\n .default('halfCeil')\n .optional(),\n })\n .optional()\n"],"names":["zNumFormat","z"],"mappings":";AAsGO,MAAMA,aAAaC,EAAAA,MACjB,CAAC;IACN,MAAMA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAU;QAAW;QAAY;KAAa,EAAE,OAAO,CAAC,UAAU,QAAQ;IACxF,OAAOA,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,QAAQ;IACrC,QAAQA,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,QAAQ;IACvC,mBAAmBA,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,QAAQ;IACtD,QAAQA,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,QAAQ;IACvC,QAAQA,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,QAAQ;IAEvC,gBAAgBA,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,QAAQ;IAC9C,mBAAmBA,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,QAAQ;IACjD,kBAAkBA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAiB;KAAgB,EAAE,OAAO,CAAC,iBAAiB,QAAQ;IAC9F,cAAcA,CAAC,CAADA,OACP,CAAC;QAAC;QAAS;QAAQ;QAAY;QAAU;QAAS;QAAa;QAAY;QAAc;KAAY,EACzG,OAAO,CAAC,YACR,QAAQ;AACb,GACC,QAAQ"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { MeasureEncoding } from '../encoding';
|
2
|
-
import type { NumFormat } from '
|
2
|
+
import type { NumFormat } from '../format/numFormat';
|
3
3
|
/**
|
4
4
|
* @description 指标
|
5
5
|
*/
|
@@ -14,7 +14,7 @@ export type Measure = {
|
|
14
14
|
*/
|
15
15
|
alias?: string;
|
16
16
|
/**
|
17
|
-
* @description 自动数值格式化
|
17
|
+
* @description 自动数值格式化 当配置了 format 时, 该配置项失效
|
18
18
|
* 开启后, 图表的数据标签、提示信息, 会根据指标的数值, 自动根据语言环境, 选择合适的格式化方式
|
19
19
|
* 格式化规则为设置为十进制数值, 开启compact notation, 最小0位小数, 最大2位小数, 自动四舍五入, 使用浏览器提供的 Intl.NumberFormatOptions 实现该逻辑.
|
20
20
|
* 例如:
|
@@ -26,6 +26,10 @@ export type Measure = {
|
|
26
26
|
/**
|
27
27
|
* @description 指标的数值格式化, 会自动应用于label、tooltip
|
28
28
|
*/
|
29
|
+
numFormat?: NumFormat;
|
30
|
+
/**
|
31
|
+
* @description same as numFormat, 指标的数值格式化, 会自动应用于label、tooltip
|
32
|
+
*/
|
29
33
|
format?: NumFormat;
|
30
34
|
/**
|
31
35
|
* @description 指标映射的通道
|
@@ -5,6 +5,36 @@ export declare const zDualMeasure: z.ZodObject<{
|
|
5
5
|
id: z.ZodString;
|
6
6
|
alias: z.ZodOptional<z.ZodString>;
|
7
7
|
autoFormat: z.ZodDefault<z.ZodBoolean>;
|
8
|
+
numFormat: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
9
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
10
|
+
number: "number";
|
11
|
+
percent: "percent";
|
12
|
+
permille: "permille";
|
13
|
+
scientific: "scientific";
|
14
|
+
}>>>;
|
15
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
16
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
17
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
18
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
19
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
20
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
21
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
22
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
23
|
+
morePrecision: "morePrecision";
|
24
|
+
lessPrecision: "lessPrecision";
|
25
|
+
}>>>;
|
26
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
27
|
+
floor: "floor";
|
28
|
+
ceil: "ceil";
|
29
|
+
expand: "expand";
|
30
|
+
trunc: "trunc";
|
31
|
+
halfCeil: "halfCeil";
|
32
|
+
halfFloor: "halfFloor";
|
33
|
+
halfExpand: "halfExpand";
|
34
|
+
halfTrunc: "halfTrunc";
|
35
|
+
halfEven: "halfEven";
|
36
|
+
}>>>;
|
37
|
+
}, z.core.$strip>>>;
|
8
38
|
format: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
9
39
|
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
10
40
|
number: "number";
|
@@ -54,6 +84,36 @@ export declare const zDualMeasure: z.ZodObject<{
|
|
54
84
|
id: z.ZodString;
|
55
85
|
alias: z.ZodOptional<z.ZodString>;
|
56
86
|
autoFormat: z.ZodDefault<z.ZodBoolean>;
|
87
|
+
numFormat: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
88
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
89
|
+
number: "number";
|
90
|
+
percent: "percent";
|
91
|
+
permille: "permille";
|
92
|
+
scientific: "scientific";
|
93
|
+
}>>>;
|
94
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
95
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
96
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
97
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
98
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
99
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
100
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
101
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
102
|
+
morePrecision: "morePrecision";
|
103
|
+
lessPrecision: "lessPrecision";
|
104
|
+
}>>>;
|
105
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
106
|
+
floor: "floor";
|
107
|
+
ceil: "ceil";
|
108
|
+
expand: "expand";
|
109
|
+
trunc: "trunc";
|
110
|
+
halfCeil: "halfCeil";
|
111
|
+
halfFloor: "halfFloor";
|
112
|
+
halfExpand: "halfExpand";
|
113
|
+
halfTrunc: "halfTrunc";
|
114
|
+
halfEven: "halfEven";
|
115
|
+
}>>>;
|
116
|
+
}, z.core.$strip>>>;
|
57
117
|
format: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
58
118
|
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
59
119
|
number: "number";
|
@@ -104,6 +164,36 @@ export declare const zDualMeasure: z.ZodObject<{
|
|
104
164
|
id: z.ZodString;
|
105
165
|
alias: z.ZodOptional<z.ZodString>;
|
106
166
|
autoFormat: z.ZodDefault<z.ZodBoolean>;
|
167
|
+
numFormat: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
168
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
169
|
+
number: "number";
|
170
|
+
percent: "percent";
|
171
|
+
permille: "permille";
|
172
|
+
scientific: "scientific";
|
173
|
+
}>>>;
|
174
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
175
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
176
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
177
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
178
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
179
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
180
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
181
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
182
|
+
morePrecision: "morePrecision";
|
183
|
+
lessPrecision: "lessPrecision";
|
184
|
+
}>>>;
|
185
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
186
|
+
floor: "floor";
|
187
|
+
ceil: "ceil";
|
188
|
+
expand: "expand";
|
189
|
+
trunc: "trunc";
|
190
|
+
halfCeil: "halfCeil";
|
191
|
+
halfFloor: "halfFloor";
|
192
|
+
halfExpand: "halfExpand";
|
193
|
+
halfTrunc: "halfTrunc";
|
194
|
+
halfEven: "halfEven";
|
195
|
+
}>>>;
|
196
|
+
}, z.core.$strip>>>;
|
107
197
|
format: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
108
198
|
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
109
199
|
number: "number";
|
@@ -153,6 +243,36 @@ export declare const zDualMeasure: z.ZodObject<{
|
|
153
243
|
id: z.ZodString;
|
154
244
|
alias: z.ZodOptional<z.ZodString>;
|
155
245
|
autoFormat: z.ZodDefault<z.ZodBoolean>;
|
246
|
+
numFormat: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
247
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
248
|
+
number: "number";
|
249
|
+
percent: "percent";
|
250
|
+
permille: "permille";
|
251
|
+
scientific: "scientific";
|
252
|
+
}>>>;
|
253
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
254
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
255
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
256
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
257
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
258
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
259
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
260
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
261
|
+
morePrecision: "morePrecision";
|
262
|
+
lessPrecision: "lessPrecision";
|
263
|
+
}>>>;
|
264
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
265
|
+
floor: "floor";
|
266
|
+
ceil: "ceil";
|
267
|
+
expand: "expand";
|
268
|
+
trunc: "trunc";
|
269
|
+
halfCeil: "halfCeil";
|
270
|
+
halfFloor: "halfFloor";
|
271
|
+
halfExpand: "halfExpand";
|
272
|
+
halfTrunc: "halfTrunc";
|
273
|
+
halfEven: "halfEven";
|
274
|
+
}>>>;
|
275
|
+
}, z.core.$strip>>>;
|
156
276
|
format: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
157
277
|
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
158
278
|
number: "number";
|
@@ -206,6 +326,36 @@ export declare const zDualMeasures: z.ZodArray<z.ZodObject<{
|
|
206
326
|
id: z.ZodString;
|
207
327
|
alias: z.ZodOptional<z.ZodString>;
|
208
328
|
autoFormat: z.ZodDefault<z.ZodBoolean>;
|
329
|
+
numFormat: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
330
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
331
|
+
number: "number";
|
332
|
+
percent: "percent";
|
333
|
+
permille: "permille";
|
334
|
+
scientific: "scientific";
|
335
|
+
}>>>;
|
336
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
337
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
338
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
339
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
340
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
341
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
342
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
343
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
344
|
+
morePrecision: "morePrecision";
|
345
|
+
lessPrecision: "lessPrecision";
|
346
|
+
}>>>;
|
347
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
348
|
+
floor: "floor";
|
349
|
+
ceil: "ceil";
|
350
|
+
expand: "expand";
|
351
|
+
trunc: "trunc";
|
352
|
+
halfCeil: "halfCeil";
|
353
|
+
halfFloor: "halfFloor";
|
354
|
+
halfExpand: "halfExpand";
|
355
|
+
halfTrunc: "halfTrunc";
|
356
|
+
halfEven: "halfEven";
|
357
|
+
}>>>;
|
358
|
+
}, z.core.$strip>>>;
|
209
359
|
format: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
210
360
|
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
211
361
|
number: "number";
|
@@ -255,6 +405,36 @@ export declare const zDualMeasures: z.ZodArray<z.ZodObject<{
|
|
255
405
|
id: z.ZodString;
|
256
406
|
alias: z.ZodOptional<z.ZodString>;
|
257
407
|
autoFormat: z.ZodDefault<z.ZodBoolean>;
|
408
|
+
numFormat: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
409
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
410
|
+
number: "number";
|
411
|
+
percent: "percent";
|
412
|
+
permille: "permille";
|
413
|
+
scientific: "scientific";
|
414
|
+
}>>>;
|
415
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
416
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
417
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
418
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
419
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
420
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
421
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
422
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
423
|
+
morePrecision: "morePrecision";
|
424
|
+
lessPrecision: "lessPrecision";
|
425
|
+
}>>>;
|
426
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
427
|
+
floor: "floor";
|
428
|
+
ceil: "ceil";
|
429
|
+
expand: "expand";
|
430
|
+
trunc: "trunc";
|
431
|
+
halfCeil: "halfCeil";
|
432
|
+
halfFloor: "halfFloor";
|
433
|
+
halfExpand: "halfExpand";
|
434
|
+
halfTrunc: "halfTrunc";
|
435
|
+
halfEven: "halfEven";
|
436
|
+
}>>>;
|
437
|
+
}, z.core.$strip>>>;
|
258
438
|
format: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
259
439
|
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
260
440
|
number: "number";
|
@@ -305,6 +485,36 @@ export declare const zDualMeasures: z.ZodArray<z.ZodObject<{
|
|
305
485
|
id: z.ZodString;
|
306
486
|
alias: z.ZodOptional<z.ZodString>;
|
307
487
|
autoFormat: z.ZodDefault<z.ZodBoolean>;
|
488
|
+
numFormat: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
489
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
490
|
+
number: "number";
|
491
|
+
percent: "percent";
|
492
|
+
permille: "permille";
|
493
|
+
scientific: "scientific";
|
494
|
+
}>>>;
|
495
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
496
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
497
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
498
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
499
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
500
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
501
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
502
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
503
|
+
morePrecision: "morePrecision";
|
504
|
+
lessPrecision: "lessPrecision";
|
505
|
+
}>>>;
|
506
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
507
|
+
floor: "floor";
|
508
|
+
ceil: "ceil";
|
509
|
+
expand: "expand";
|
510
|
+
trunc: "trunc";
|
511
|
+
halfCeil: "halfCeil";
|
512
|
+
halfFloor: "halfFloor";
|
513
|
+
halfExpand: "halfExpand";
|
514
|
+
halfTrunc: "halfTrunc";
|
515
|
+
halfEven: "halfEven";
|
516
|
+
}>>>;
|
517
|
+
}, z.core.$strip>>>;
|
308
518
|
format: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
309
519
|
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
310
520
|
number: "number";
|
@@ -354,6 +564,36 @@ export declare const zDualMeasures: z.ZodArray<z.ZodObject<{
|
|
354
564
|
id: z.ZodString;
|
355
565
|
alias: z.ZodOptional<z.ZodString>;
|
356
566
|
autoFormat: z.ZodDefault<z.ZodBoolean>;
|
567
|
+
numFormat: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
568
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
569
|
+
number: "number";
|
570
|
+
percent: "percent";
|
571
|
+
permille: "permille";
|
572
|
+
scientific: "scientific";
|
573
|
+
}>>>;
|
574
|
+
ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
575
|
+
symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
576
|
+
thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
577
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
578
|
+
suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
579
|
+
fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
580
|
+
significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
581
|
+
roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
582
|
+
morePrecision: "morePrecision";
|
583
|
+
lessPrecision: "lessPrecision";
|
584
|
+
}>>>;
|
585
|
+
roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
586
|
+
floor: "floor";
|
587
|
+
ceil: "ceil";
|
588
|
+
expand: "expand";
|
589
|
+
trunc: "trunc";
|
590
|
+
halfCeil: "halfCeil";
|
591
|
+
halfFloor: "halfFloor";
|
592
|
+
halfExpand: "halfExpand";
|
593
|
+
halfTrunc: "halfTrunc";
|
594
|
+
halfEven: "halfEven";
|
595
|
+
}>>>;
|
596
|
+
}, z.core.$strip>>>;
|
357
597
|
format: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
358
598
|
type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
359
599
|
number: "number";
|