@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 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/axes/yLinearSecondary.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/yLinearSecondary.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport { LINEAR_AXIS_INNER_OFFSET_TOP } from '../../../../utils/constant'\nimport { autoFormatter } from '../../../../utils'\nimport type { SpecPipe, YLinearAxis } from 'src/types'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const yLinearSecondary: SpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const { locale, datasetReshapeInfo } = advancedVSeed\n const { index, id: reshapeInfoId, foldInfoList } = datasetReshapeInfo[0]\n // TODO: default config missing\n const secondaryYAxis = advancedVSeed.config?.[chartType as 'dualAxis']?.secondaryYAxis as YLinearAxis | YLinearAxis[]\n const yAxisConfig = Array.isArray(secondaryYAxis) ? secondaryYAxis[index] || secondaryYAxis[0] : secondaryYAxis\n const alignTicks = advancedVSeed.config?.[chartType as 'dualAxis']?.alignTicks as boolean | boolean[]\n const alignTicksConfig = Array.isArray(alignTicks) ? alignTicks[index] || alignTicks[0] : alignTicks\n\n if (isNullish(foldInfoList?.[1])) {\n return result\n }\n\n const isEmptySecondary = isEmpty(foldInfoList?.[1].foldMap)\n const onlySecondary = isEmpty(foldInfoList?.[0].foldMap) && !isEmptySecondary\n\n const sync = {\n axisId: `${reshapeInfoId}-primary-axis`,\n zeroAlign: true,\n }\n\n const id = `${reshapeInfoId}-secondary-axis`\n const seriesIds = [`${reshapeInfoId}-primary-series`, `${reshapeInfoId}-secondary-series`]\n const seriesId = alignTicksConfig ? seriesIds : seriesIds[1]\n if (!result.axes) {\n result.axes = []\n }\n\n if (!yAxisConfig) {\n result.axes = [\n ...result.axes,\n {\n visible: true,\n id,\n seriesId,\n type: 'linear',\n orient: 'right',\n sync,\n },\n ] as ISpec['axes']\n return result\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n\n zero,\n nice,\n inverse,\n max,\n min,\n log,\n logBase = 10,\n } = yAxisConfig\n\n const linearAxis = {\n visible: isEmptySecondary ? false : visible,\n id,\n seriesId,\n sync,\n type: log ? 'log' : 'linear',\n base: logBase,\n orient: 'right',\n nice,\n zero: log ? false : zero,\n inverse,\n max,\n min,\n label: {\n visible: label?.visible,\n formatMethod: (value: string) => {\n return autoFormatter(value, locale)\n },\n style: {\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n },\n title: {\n visible: title?.visible,\n text: title?.titleText,\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: onlySecondary ? true : grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n innerOffset: {\n top: LINEAR_AXIS_INNER_OFFSET_TOP,\n // bottom: LINEAR_AXIS_INNER_OFFSET_TOP,\n },\n }\n\n result.axes = [...result.axes, linearAxis] as ISpec['axes']\n\n return result\n}\n"],"names":["yLinearSecondary","spec","context","result","advancedVSeed","vseed","chartType","locale","datasetReshapeInfo","index","reshapeInfoId","foldInfoList","secondaryYAxis","yAxisConfig","Array","alignTicks","alignTicksConfig","isNullish","isEmptySecondary","isEmpty","onlySecondary","sync","id","seriesIds","seriesId","visible","label","tick","title","grid","line","zero","nice","inverse","max","min","log","logBase","linearAxis","value","autoFormatter","LINEAR_AXIS_INNER_OFFSET_TOP"],"mappings":";;;AAMO,MAAMA,mBAA6B,CAACC,MAAMC;IAC/C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAE,GAAGD;IACtB,MAAM,EAAEE,MAAM,EAAEC,kBAAkB,EAAE,GAAGJ;IACvC,MAAM,EAAEK,KAAK,EAAE,IAAIC,aAAa,EAAEC,YAAY,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAExE,MAAMI,iBAAiBR,cAAc,MAAM,EAAE,CAACE,UAAwB,EAAE;IACxE,MAAMO,cAAcC,MAAM,OAAO,CAACF,kBAAkBA,cAAc,CAACH,MAAM,IAAIG,cAAc,CAAC,EAAE,GAAGA;IACjG,MAAMG,aAAaX,cAAc,MAAM,EAAE,CAACE,UAAwB,EAAE;IACpE,MAAMU,mBAAmBF,MAAM,OAAO,CAACC,cAAcA,UAAU,CAACN,MAAM,IAAIM,UAAU,CAAC,EAAE,GAAGA;IAE1F,IAAIE,UAAUN,cAAc,CAAC,EAAE,GAC7B,OAAOR;IAGT,MAAMe,mBAAmBC,QAAQR,cAAc,CAAC,EAAE,CAAC;IACnD,MAAMS,gBAAgBD,QAAQR,cAAc,CAAC,EAAE,CAAC,YAAY,CAACO;IAE7D,MAAMG,OAAO;QACX,QAAQ,GAAGX,cAAc,aAAa,CAAC;QACvC,WAAW;IACb;IAEA,MAAMY,KAAK,GAAGZ,cAAc,eAAe,CAAC;IAC5C,MAAMa,YAAY;QAAC,GAAGb,cAAc,eAAe,CAAC;QAAE,GAAGA,cAAc,iBAAiB,CAAC;KAAC;IAC1F,MAAMc,WAAWR,mBAAmBO,YAAYA,SAAS,CAAC,EAAE;IAC5D,IAAI,CAACpB,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlB,IAAI,CAACU,aAAa;QAChBV,OAAO,IAAI,GAAG;eACTA,OAAO,IAAI;YACd;gBACE,SAAS;gBACTmB;gBACAE;gBACA,MAAM;gBACN,QAAQ;gBACRH;YACF;SACD;QACD,OAAOlB;IACT;IAEA,MAAM,EACJsB,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EAEJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,GAAG,EACHC,GAAG,EACHC,GAAG,EACHC,UAAU,EAAE,
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/axes/yLinearSecondary.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/yLinearSecondary.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport { LINEAR_AXIS_INNER_OFFSET_TOP } from '../../../../utils/constant'\nimport { autoFormatter, createNumFormatter } from '../../../../utils'\nimport type { SpecPipe, YLinearAxis } from 'src/types'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const yLinearSecondary: SpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const { locale, datasetReshapeInfo } = advancedVSeed\n const { index, id: reshapeInfoId, foldInfoList } = datasetReshapeInfo[0]\n // TODO: default config missing\n const secondaryYAxis = advancedVSeed.config?.[chartType as 'dualAxis']?.secondaryYAxis as YLinearAxis | YLinearAxis[]\n const yAxisConfig = Array.isArray(secondaryYAxis) ? secondaryYAxis[index] || secondaryYAxis[0] : secondaryYAxis\n const alignTicks = advancedVSeed.config?.[chartType as 'dualAxis']?.alignTicks as boolean | boolean[]\n const alignTicksConfig = Array.isArray(alignTicks) ? alignTicks[index] || alignTicks[0] : alignTicks\n\n if (isNullish(foldInfoList?.[1])) {\n return result\n }\n\n const isEmptySecondary = isEmpty(foldInfoList?.[1].foldMap)\n const onlySecondary = isEmpty(foldInfoList?.[0].foldMap) && !isEmptySecondary\n\n const sync = {\n axisId: `${reshapeInfoId}-primary-axis`,\n zeroAlign: true,\n }\n\n const id = `${reshapeInfoId}-secondary-axis`\n const seriesIds = [`${reshapeInfoId}-primary-series`, `${reshapeInfoId}-secondary-series`]\n const seriesId = alignTicksConfig ? seriesIds : seriesIds[1]\n if (!result.axes) {\n result.axes = []\n }\n\n if (!yAxisConfig) {\n result.axes = [\n ...result.axes,\n {\n visible: true,\n id,\n seriesId,\n type: 'linear',\n orient: 'right',\n sync,\n },\n ] as ISpec['axes']\n return result\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n\n zero,\n nice,\n inverse,\n max,\n min,\n log,\n logBase = 10,\n numFormat = {},\n autoFormat = true,\n } = yAxisConfig\n\n const formatter = createNumFormatter(numFormat, locale)\n\n const linearAxis = {\n visible: isEmptySecondary ? false : visible,\n id,\n seriesId,\n sync,\n type: log ? 'log' : 'linear',\n base: logBase,\n orient: 'right',\n nice,\n zero: log ? false : zero,\n inverse,\n max,\n min,\n label: {\n visible: label?.visible,\n formatMethod: (value: string) => {\n if (!isEmpty(numFormat)) {\n return formatter(value)\n }\n if (autoFormat) {\n return autoFormatter(value, locale)\n }\n return value\n },\n style: {\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n },\n title: {\n visible: title?.visible,\n text: title?.titleText,\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: onlySecondary ? true : grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n innerOffset: {\n top: LINEAR_AXIS_INNER_OFFSET_TOP,\n // bottom: LINEAR_AXIS_INNER_OFFSET_TOP,\n },\n }\n\n result.axes = [...result.axes, linearAxis] as ISpec['axes']\n\n return result\n}\n"],"names":["yLinearSecondary","spec","context","result","advancedVSeed","vseed","chartType","locale","datasetReshapeInfo","index","reshapeInfoId","foldInfoList","secondaryYAxis","yAxisConfig","Array","alignTicks","alignTicksConfig","isNullish","isEmptySecondary","isEmpty","onlySecondary","sync","id","seriesIds","seriesId","visible","label","tick","title","grid","line","zero","nice","inverse","max","min","log","logBase","numFormat","autoFormat","formatter","createNumFormatter","linearAxis","value","autoFormatter","LINEAR_AXIS_INNER_OFFSET_TOP"],"mappings":"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"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { label } from "./label.js";
|
2
|
-
import { labelColorInversion } from "./labelColorInversion.js";
|
3
2
|
import { labelPrimary, labelSecondary } from "./labelDualAxis.js";
|
4
|
-
|
3
|
+
import { labelScatter } from "./labelScatter.js";
|
4
|
+
export { label, labelPrimary, labelScatter, labelSecondary };
|
@@ -1,2 +1,6 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface';
|
2
|
+
import type { Dimensions, Encoding, FoldInfo, Formatter, Label, Measure, Measures, NumFormat, SpecPipe } from '../../../../../types';
|
2
3
|
export declare const label: SpecPipe;
|
4
|
+
export declare const generateMeasureValue: (value: number | string, measure?: Measure, labelAutoFormat?: boolean, numFormat?: NumFormat) => string | number;
|
5
|
+
export declare const generateMeasurePercent: (value: number | string, sum: number, formatter: Formatter) => string;
|
6
|
+
export declare const buildLabel: (label: Label, vseedMeasures: Measures | undefined, vseedDimensions: Dimensions | undefined, advancedVSeedMeasures: Measures, encoding: Encoding, foldInfoList: FoldInfo[]) => ILineLikeLabelSpec;
|
@@ -1,60 +1,81 @@
|
|
1
|
-
import {
|
2
|
-
import { isEmpty, uniqueBy } from "remeda";
|
3
|
-
import { intl } from "../../../../../i18n/index.js";
|
1
|
+
import { createFormatter, createFormatterByMeasure, findMeasureById } from "../../../../utils/index.js";
|
2
|
+
import { isEmpty, merge, uniqueBy } from "remeda";
|
4
3
|
const label_label = (spec, context)=>{
|
5
4
|
const result = {
|
6
5
|
...spec
|
7
6
|
};
|
8
7
|
const { advancedVSeed, vseed } = context;
|
9
|
-
const {
|
8
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
10
9
|
const { chartType, encoding } = advancedVSeed;
|
11
10
|
const baseConfig = advancedVSeed.config[chartType];
|
12
|
-
|
13
|
-
|
11
|
+
const foldInfo = datasetReshapeInfo[0].foldInfo;
|
12
|
+
if (!baseConfig || isEmpty(baseConfig.label)) return result;
|
14
13
|
const { label } = baseConfig;
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, [
|
15
|
+
foldInfo
|
16
|
+
]);
|
17
|
+
return result;
|
18
|
+
};
|
19
|
+
const generateMeasureValue = (value, measure, labelAutoFormat = true, numFormat = {})=>{
|
20
|
+
if (!measure) return value;
|
21
|
+
const format = merge(numFormat, measure.numFormat || measure.format);
|
22
|
+
const mergedMeasure = {
|
23
|
+
...measure,
|
24
|
+
numFormat: format,
|
25
|
+
autoFormat: labelAutoFormat || measure.autoFormat
|
20
26
|
};
|
21
|
-
const formatter =
|
22
|
-
|
27
|
+
const formatter = createFormatterByMeasure(mergedMeasure);
|
28
|
+
return formatter(value);
|
29
|
+
};
|
30
|
+
const generateMeasurePercent = (value, sum, formatter)=>{
|
31
|
+
if (null == value) return String(value);
|
32
|
+
const num = Number(value);
|
33
|
+
if (Number.isNaN(num)) return String(value);
|
34
|
+
const percentValue = num / sum;
|
35
|
+
return formatter(percentValue);
|
36
|
+
};
|
37
|
+
const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSeedMeasures, encoding, foldInfoList)=>{
|
38
|
+
const { enable, wrap, showValue, showValuePercent, labelOverlap, labelColorSmartInvert, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat = true, numFormat = {} } = label;
|
39
|
+
const labelDims = uniqueBy((vseedDimensions || []).filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
40
|
+
const labelMeas = uniqueBy((vseedMeasures || []).filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
41
|
+
const percentFormat = merge(numFormat, {
|
42
|
+
type: 'percent'
|
43
|
+
});
|
44
|
+
const percentFormatter = createFormatter(percentFormat);
|
45
|
+
const result = {
|
23
46
|
visible: enable,
|
24
47
|
formatMethod: (_, datum)=>{
|
25
48
|
const result = [];
|
26
|
-
const measure = findMeasureById(measures, datum[measureId]);
|
27
49
|
const dimLabels = labelDims.map((item)=>item.alias || item.id);
|
28
|
-
const meaLabels = labelMeas.map((item)=>generateMeasureValue(datum[item.id], item));
|
29
|
-
const measureValueLabel = generateMeasureValue(datum[measureValue], measure);
|
30
|
-
const measurePercentLabel = generateMeasurePercent(datum[measureValue], statistics.sum, formatter);
|
50
|
+
const meaLabels = labelMeas.map((item)=>generateMeasureValue(datum[item.id], item, autoFormat, numFormat));
|
31
51
|
result.push(...dimLabels);
|
32
|
-
|
33
|
-
|
52
|
+
foldInfoList.forEach((foldInfo)=>{
|
53
|
+
const { measureId, measureValue, statistics } = foldInfo;
|
54
|
+
const measure = findMeasureById(advancedVSeedMeasures, datum[measureId]);
|
55
|
+
const measureValueLabel = generateMeasureValue(datum[measureValue], measure, autoFormat, numFormat);
|
56
|
+
const measurePercentLabel = generateMeasurePercent(datum[measureValue], statistics.sum, percentFormatter);
|
57
|
+
if (showValue) result.push(measureValueLabel);
|
58
|
+
if (showValuePercent) result.push(measurePercentLabel);
|
59
|
+
});
|
34
60
|
result.push(...meaLabels);
|
35
61
|
if (wrap) return result;
|
36
62
|
return result.join(' ');
|
37
|
-
}
|
63
|
+
},
|
64
|
+
position: labelPosition,
|
65
|
+
style: {
|
66
|
+
fill: labelColor,
|
67
|
+
fontSize: labelFontSize,
|
68
|
+
fontWeight: labelFontWeight,
|
69
|
+
background: labelBackgroundColor
|
70
|
+
},
|
71
|
+
smartInvert: labelColorSmartInvert
|
72
|
+
};
|
73
|
+
if (labelOverlap) result.overlap = {
|
74
|
+
hideOnHit: true,
|
75
|
+
clampForce: true
|
38
76
|
};
|
39
77
|
return result;
|
40
78
|
};
|
41
|
-
|
42
|
-
if (!measure) return value;
|
43
|
-
const { format = {}, autoFormat = true } = measure;
|
44
|
-
if (!isEmpty(format)) {
|
45
|
-
const formatter = createFormatter(format);
|
46
|
-
return formatter(value);
|
47
|
-
}
|
48
|
-
if (autoFormat) return autoFormatter(value, intl.getLocale());
|
49
|
-
return String(value);
|
50
|
-
};
|
51
|
-
const generateMeasurePercent = (value, sum, formatter)=>{
|
52
|
-
if (null == value) return String(value);
|
53
|
-
const num = Number(value);
|
54
|
-
if (Number.isNaN(num)) return String(value);
|
55
|
-
const percentValue = num / sum;
|
56
|
-
return formatter(percentValue);
|
57
|
-
};
|
58
|
-
export { label_label as label };
|
79
|
+
export { buildLabel, generateMeasurePercent, generateMeasureValue, label_label as label };
|
59
80
|
|
60
81
|
//# sourceMappingURL=label.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/label/label.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/label.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface'\nimport {
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/label/label.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/label.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface'\nimport { createFormatter, createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n Encoding,\n FoldInfo,\n Formatter,\n Label,\n Measure,\n Measures,\n NumFormat,\n SpecPipe,\n} from 'src/types'\nimport { isEmpty, merge, uniqueBy } from 'remeda'\n\nexport const label: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n const foldInfo = datasetReshapeInfo[0].foldInfo as FoldInfo\n if (!baseConfig || isEmpty(baseConfig.label)) {\n return result\n }\n\n const { label } = baseConfig\n\n result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding as Encoding, [\n foldInfo,\n ])\n\n return result\n}\n\nexport const generateMeasureValue = (\n value: number | string,\n measure?: Measure,\n labelAutoFormat: boolean = true,\n numFormat: NumFormat = {},\n) => {\n if (!measure) {\n return value\n }\n\n const format = merge(numFormat, measure.numFormat || measure.format)\n const mergedMeasure = { ...measure, numFormat: format, autoFormat: labelAutoFormat || measure.autoFormat }\n\n const formatter = createFormatterByMeasure(mergedMeasure)\n return formatter(value)\n}\n\nexport const generateMeasurePercent = (value: number | string, sum: number, formatter: Formatter) => {\n if (value === undefined || value === null) return String(value)\n const num = Number(value)\n if (Number.isNaN(num)) return String(value)\n\n const percentValue = num / sum\n return formatter(percentValue)\n}\n\nexport const buildLabel = (\n label: Label,\n vseedMeasures: Measures = [],\n vseedDimensions: Dimensions = [],\n advancedVSeedMeasures: Measures,\n encoding: Encoding,\n foldInfoList: FoldInfo[],\n) => {\n const {\n enable,\n wrap,\n showValue,\n showValuePercent,\n labelOverlap,\n labelColorSmartInvert,\n labelColor,\n labelFontSize,\n labelFontWeight,\n labelBackgroundColor,\n labelPosition,\n autoFormat = true,\n numFormat = {},\n } = label\n\n const labelDims = uniqueBy(\n (vseedDimensions || []).filter((item) => encoding.label?.includes(item.id)),\n (item) => item.id,\n )\n const labelMeas = uniqueBy(\n (vseedMeasures || []).filter((item) => encoding.label?.includes(item.id)),\n (item) => item.id,\n )\n\n const percentFormat: NumFormat = merge(numFormat, {\n type: 'percent',\n } as NumFormat)\n\n const percentFormatter = createFormatter(percentFormat)\n\n const result = {\n visible: enable,\n formatMethod: (_, datum: Datum) => {\n const result = []\n\n const dimLabels = labelDims.map((item) => item.alias || item.id)\n const meaLabels = labelMeas.map((item) =>\n generateMeasureValue(datum[item.id] as number | string, item, autoFormat, numFormat),\n )\n\n result.push(...dimLabels)\n\n foldInfoList.forEach((foldInfo) => {\n const { measureId, measureValue, statistics } = foldInfo\n const measure = findMeasureById(advancedVSeedMeasures, datum[measureId] as string)\n const measureValueLabel = generateMeasureValue(\n datum[measureValue] as number | string,\n measure,\n autoFormat,\n numFormat,\n )\n const measurePercentLabel = generateMeasurePercent(\n datum[measureValue] as number | string,\n statistics.sum,\n percentFormatter,\n )\n if (showValue) {\n result.push(measureValueLabel)\n }\n if (showValuePercent) {\n result.push(measurePercentLabel)\n }\n })\n\n result.push(...meaLabels)\n\n if (wrap) {\n return result\n }\n return result.join(' ')\n },\n position: labelPosition,\n style: {\n fill: labelColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n background: labelBackgroundColor,\n },\n smartInvert: labelColorSmartInvert,\n } as ILineLikeLabelSpec\n\n if (labelOverlap) {\n result.overlap = {\n hideOnHit: true,\n clampForce: true,\n }\n }\n\n return result\n}\n"],"names":["label","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","encoding","baseConfig","foldInfo","isEmpty","buildLabel","generateMeasureValue","value","measure","labelAutoFormat","numFormat","format","merge","mergedMeasure","formatter","createFormatterByMeasure","generateMeasurePercent","sum","String","num","Number","percentValue","vseedMeasures","vseedDimensions","advancedVSeedMeasures","foldInfoList","enable","wrap","showValue","showValuePercent","labelOverlap","labelColorSmartInvert","labelColor","labelFontSize","labelFontWeight","labelBackgroundColor","labelPosition","autoFormat","labelDims","uniqueBy","item","labelMeas","percentFormat","percentFormatter","createFormatter","_","datum","dimLabels","meaLabels","measureId","measureValue","statistics","findMeasureById","measureValueLabel","measurePercentLabel"],"mappings":"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"}
|
@@ -1,74 +1,37 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { isNullish } from "remeda";
|
2
|
+
import { buildLabel } from "./label.js";
|
3
|
+
import { DUAL_AXIS_LABEL_Z_INDEX } from "../../../../utils/constant.js";
|
3
4
|
const labelPrimary = (spec, context)=>{
|
4
5
|
const result = {
|
5
6
|
...spec
|
6
7
|
};
|
7
|
-
const { advancedVSeed } = context;
|
8
|
-
const {
|
8
|
+
const { advancedVSeed, vseed } = context;
|
9
|
+
const { datasetReshapeInfo, encoding } = advancedVSeed;
|
9
10
|
const { chartType } = advancedVSeed;
|
10
11
|
const baseConfig = advancedVSeed.config[chartType];
|
11
12
|
if (!baseConfig || !baseConfig.label) return result;
|
12
13
|
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
result.label =
|
17
|
-
visible: enable,
|
18
|
-
formatMethod: (value, datum)=>{
|
19
|
-
const result = [];
|
20
|
-
const formatValue = (value)=>{
|
21
|
-
const id = datum[measureId];
|
22
|
-
const measure = findMeasureById(measures, id);
|
23
|
-
if (!measure) return value;
|
24
|
-
const { format = {}, autoFormat = true } = measure;
|
25
|
-
if (!isEmpty(format)) {
|
26
|
-
const formatter = createFormatter(format);
|
27
|
-
return formatter(value);
|
28
|
-
}
|
29
|
-
if (autoFormat) return autoFormatter(value, locale);
|
30
|
-
return String(value);
|
31
|
-
};
|
32
|
-
result.push(formatValue(datum[measureValue]));
|
33
|
-
return result.join(' ');
|
34
|
-
}
|
35
|
-
};
|
14
|
+
result.label = buildLabel(baseConfig.label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, [
|
15
|
+
foldInfoList[0]
|
16
|
+
]);
|
17
|
+
result.label.zIndex = DUAL_AXIS_LABEL_Z_INDEX;
|
36
18
|
return result;
|
37
19
|
};
|
38
20
|
const labelSecondary = (spec, context)=>{
|
39
21
|
const result = {
|
40
22
|
...spec
|
41
23
|
};
|
42
|
-
const { advancedVSeed } = context;
|
43
|
-
const {
|
24
|
+
const { advancedVSeed, vseed } = context;
|
25
|
+
const { datasetReshapeInfo, encoding } = advancedVSeed;
|
44
26
|
const { chartType } = advancedVSeed;
|
45
27
|
const baseConfig = advancedVSeed.config[chartType];
|
46
28
|
if (!baseConfig || !baseConfig.label) return result;
|
47
29
|
if (isNullish(datasetReshapeInfo[0].foldInfoList?.[1])) return result;
|
48
30
|
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
result.label =
|
53
|
-
visible: enable,
|
54
|
-
formatMethod: (value, datum)=>{
|
55
|
-
const result = [];
|
56
|
-
const formatValue = (value)=>{
|
57
|
-
const id = datum[measureId];
|
58
|
-
const measure = findMeasureById(measures, id);
|
59
|
-
if (!measure) return value;
|
60
|
-
const { format = {}, autoFormat = true } = measure;
|
61
|
-
if (!isEmpty(format)) {
|
62
|
-
const formatter = createFormatter(format);
|
63
|
-
return formatter(value);
|
64
|
-
}
|
65
|
-
if (autoFormat) return autoFormatter(value, locale);
|
66
|
-
return String(value);
|
67
|
-
};
|
68
|
-
result.push(formatValue(datum[measureValue]));
|
69
|
-
return result.join(' ');
|
70
|
-
}
|
71
|
-
};
|
31
|
+
result.label = buildLabel(baseConfig.label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, [
|
32
|
+
foldInfoList[1]
|
33
|
+
]);
|
34
|
+
result.label.zIndex = DUAL_AXIS_LABEL_Z_INDEX;
|
72
35
|
return result;
|
73
36
|
};
|
74
37
|
export { labelPrimary, labelSecondary };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/label/labelDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/labelDualAxis.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type {
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/label/labelDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/labelDualAxis.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { Encoding, FoldInfo, Label, SpecPipe } from 'src/types'\nimport { isNullish } from 'remeda'\nimport { buildLabel } from './label'\nimport { DUAL_AXIS_LABEL_Z_INDEX } from 'src/pipeline/utils/constant'\n\nexport const labelPrimary: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, encoding } = advancedVSeed\n const { chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n\n if (!baseConfig || !baseConfig.label) {\n return result\n }\n\n const foldInfoList = datasetReshapeInfo[0].foldInfoList as FoldInfo[]\n result.label = buildLabel(\n baseConfig.label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfoList[0]],\n )\n result.label.zIndex = DUAL_AXIS_LABEL_Z_INDEX\n return result\n}\n\nexport const labelSecondary: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, encoding } = advancedVSeed\n const { chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n\n if (!baseConfig || !baseConfig.label) {\n return result\n }\n if (isNullish(datasetReshapeInfo[0].foldInfoList?.[1])) {\n return result\n }\n const foldInfoList = datasetReshapeInfo[0].foldInfoList as FoldInfo[]\n\n result.label = buildLabel(\n baseConfig.label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfoList[1]],\n )\n result.label.zIndex = DUAL_AXIS_LABEL_Z_INDEX\n return result\n}\n"],"names":["labelPrimary","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","encoding","chartType","baseConfig","foldInfoList","buildLabel","DUAL_AXIS_LABEL_Z_INDEX","labelSecondary","isNullish"],"mappings":";;;AAMO,MAAMA,eAAyB,CAACC,MAAMC;IAC3C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,QAAQ,EAAE,GAAGH;IACzC,MAAM,EAAEI,SAAS,EAAE,GAAGJ;IACtB,MAAMK,aAAaL,cAAc,MAAM,CAACI,UAAU;IAElD,IAAI,CAACC,cAAc,CAACA,WAAW,KAAK,EAClC,OAAON;IAGT,MAAMO,eAAeJ,kBAAkB,CAAC,EAAE,CAAC,YAAY;IACvDH,OAAO,KAAK,GAAGQ,WACbF,WAAW,KAAK,EAChBJ,MAAM,QAAQ,EACdA,MAAM,UAAU,EAChBD,cAAc,QAAQ,EACtBG,UACA;QAACG,YAAY,CAAC,EAAE;KAAC;IAEnBP,OAAO,KAAK,CAAC,MAAM,GAAGS;IACtB,OAAOT;AACT;AAEO,MAAMU,iBAA2B,CAACZ,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,QAAQ,EAAE,GAAGH;IACzC,MAAM,EAAEI,SAAS,EAAE,GAAGJ;IACtB,MAAMK,aAAaL,cAAc,MAAM,CAACI,UAAU;IAElD,IAAI,CAACC,cAAc,CAACA,WAAW,KAAK,EAClC,OAAON;IAET,IAAIW,UAAUR,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,EAAE,GACnD,OAAOH;IAET,MAAMO,eAAeJ,kBAAkB,CAAC,EAAE,CAAC,YAAY;IAEvDH,OAAO,KAAK,GAAGQ,WACbF,WAAW,KAAK,EAChBJ,MAAM,QAAQ,EACdA,MAAM,UAAU,EAChBD,cAAc,QAAQ,EACtBG,UACA;QAACG,YAAY,CAAC,EAAE;KAAC;IAEnBP,OAAO,KAAK,CAAC,MAAM,GAAGS;IACtB,OAAOT;AACT"}
|
package/dist/esm/pipeline/spec/chart/pipes/label/{labelColorInversion.d.ts → labelScatter.d.ts}
RENAMED
@@ -1,2 +1,2 @@
|
|
1
1
|
import type { SpecPipe } from '../../../../../types';
|
2
|
-
export declare const
|
2
|
+
export declare const labelScatter: SpecPipe;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { isEmpty } from "remeda";
|
2
|
+
import { buildLabel } from "./label.js";
|
3
|
+
const labelScatter = (spec, context)=>{
|
4
|
+
const result = {
|
5
|
+
...spec
|
6
|
+
};
|
7
|
+
const { advancedVSeed, vseed } = context;
|
8
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
9
|
+
const { chartType, encoding } = advancedVSeed;
|
10
|
+
const baseConfig = advancedVSeed.config[chartType];
|
11
|
+
if (!baseConfig || isEmpty(baseConfig.label)) return result;
|
12
|
+
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
13
|
+
const { label } = baseConfig;
|
14
|
+
result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, foldInfoList);
|
15
|
+
return result;
|
16
|
+
};
|
17
|
+
export { labelScatter };
|
18
|
+
|
19
|
+
//# sourceMappingURL=labelScatter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/label/labelScatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/labelScatter.ts"],"sourcesContent":["import type { IScatterChartSpec } from '@visactor/vchart'\nimport type { Encoding, FoldInfo, Label, SpecPipe } from 'src/types'\nimport { isEmpty } from 'remeda'\nimport { buildLabel } from './label'\n\nexport const labelScatter: SpecPipe = (spec, context) => {\n const result = { ...spec } as IScatterChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n\n if (!baseConfig || isEmpty(baseConfig.label)) {\n return result\n }\n\n const foldInfoList = datasetReshapeInfo[0].foldInfoList as FoldInfo[]\n\n const { label } = baseConfig\n\n result.label = buildLabel(\n label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n foldInfoList,\n )\n\n return result\n}\n"],"names":["labelScatter","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","encoding","baseConfig","isEmpty","foldInfoList","label","buildLabel"],"mappings":";;AAKO,MAAMA,eAAyB,CAACC,MAAMC;IAC3C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;IAC/B,MAAM,EAAEG,SAAS,EAAEC,QAAQ,EAAE,GAAGJ;IAChC,MAAMK,aAAaL,cAAc,MAAM,CAACG,UAAU;IAElD,IAAI,CAACE,cAAcC,QAAQD,WAAW,KAAK,GACzC,OAAON;IAGT,MAAMQ,eAAeL,kBAAkB,CAAC,EAAE,CAAC,YAAY;IAEvD,MAAM,EAAEM,KAAK,EAAE,GAAGH;IAElBN,OAAO,KAAK,GAAGU,WACbD,OACAP,MAAM,QAAQ,EACdA,MAAM,UAAU,EAChBD,cAAc,QAAQ,EACtBI,UACAG;IAGF,OAAOR;AACT"}
|
@@ -8,7 +8,7 @@ const colorLegend = (spec, context)=>{
|
|
8
8
|
const baseConfig = advancedVSeed.config[chartType];
|
9
9
|
if (!baseConfig || !baseConfig.legend) return result;
|
10
10
|
const { legend } = baseConfig;
|
11
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight } = legend || {};
|
11
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight } = legend || {};
|
12
12
|
const orient = [
|
13
13
|
'bottom',
|
14
14
|
'bottomLeft',
|
@@ -58,7 +58,7 @@ const colorLegend = (spec, context)=>{
|
|
58
58
|
startText: {
|
59
59
|
visible: true,
|
60
60
|
style: {
|
61
|
-
fill: labelFontColor,
|
61
|
+
fill: labelColor || labelFontColor,
|
62
62
|
fontSize: labelFontSize,
|
63
63
|
fontWeight: labelFontWeight
|
64
64
|
}
|
@@ -66,7 +66,7 @@ const colorLegend = (spec, context)=>{
|
|
66
66
|
endText: {
|
67
67
|
visible: true,
|
68
68
|
style: {
|
69
|
-
fill: labelFontColor,
|
69
|
+
fill: labelColor || labelFontColor,
|
70
70
|
fontSize: labelFontSize,
|
71
71
|
fontWeight: labelFontWeight
|
72
72
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/legend/colorLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/colorLegend.ts"],"sourcesContent":["import type { Legend, SpecPipe } from 'src/types'\n\nexport const colorLegend: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed } = context\n const { datasetReshapeInfo, chartType } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n const baseConfig = advancedVSeed.config[chartType] as { legend: Legend }\n if (!baseConfig || !baseConfig.legend) {\n return result\n }\n\n const { legend } = baseConfig\n const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight } = legend || {}\n\n const orient = ['bottom', 'bottomLeft', 'bottomRight', 'bl', 'br'].includes(position)\n ? 'bottom'\n : ['top', 'topLeft', 'topRight', 'tl', 'tr'].includes(position)\n ? 'top'\n : ['left', 'leftTop', 'leftBottom', 'lt', 'lb'].includes(position)\n ? 'left'\n : 'right'\n\n const legendPosition = ['topLeft', 'bottomLeft', 'leftTop', 'rightTop', 'lt', 'rt', 'tl', 'bl'].includes(position)\n ? 'start'\n : ['topRight', 'bottomRight', 'leftBottom', 'rightBottom', 'lb', 'rb', 'rt', 'br'].includes(position)\n ? 'end'\n : 'middle'\n\n result.legends = {\n type: 'color',\n visible: enable,\n orient,\n position: legendPosition,\n padding: 0,\n field: unfoldInfo.encodingColor,\n maxWidth: '30%',\n startText: {\n visible: true,\n style: {\n fill: labelFontColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n },\n },\n endText: {\n visible: true,\n style: {\n fill: labelFontColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n },\n },\n }\n return result\n}\n"],"names":["colorLegend","spec","context","result","advancedVSeed","datasetReshapeInfo","chartType","unfoldInfo","baseConfig","legend","enable","position","labelFontColor","labelFontSize","labelFontWeight","orient","legendPosition"],"mappings":"AAEO,MAAMA,cAAwB,CAACC,MAAMC;IAC1C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,SAAS,EAAE,GAAGF;IAC1C,MAAM,EAAEG,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAC5C,MAAMG,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAClD,IAAI,CAACE,cAAc,CAACA,WAAW,MAAM,EACnC,OAAOL;IAGT,MAAM,EAAEM,MAAM,EAAE,GAAGD;IACnB,MAAM,EAAEE,MAAM,EAAEC,WAAW,QAAQ,EAAEC,cAAc,EAAEC,gBAAgB,EAAE,EAAEC,eAAe,EAAE,
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/legend/colorLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/colorLegend.ts"],"sourcesContent":["import type { Legend, SpecPipe } from 'src/types'\n\nexport const colorLegend: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed } = context\n const { datasetReshapeInfo, chartType } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n const baseConfig = advancedVSeed.config[chartType] as { legend: Legend }\n if (!baseConfig || !baseConfig.legend) {\n return result\n }\n\n const { legend } = baseConfig\n const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight } = legend || {}\n\n const orient = ['bottom', 'bottomLeft', 'bottomRight', 'bl', 'br'].includes(position)\n ? 'bottom'\n : ['top', 'topLeft', 'topRight', 'tl', 'tr'].includes(position)\n ? 'top'\n : ['left', 'leftTop', 'leftBottom', 'lt', 'lb'].includes(position)\n ? 'left'\n : 'right'\n\n const legendPosition = ['topLeft', 'bottomLeft', 'leftTop', 'rightTop', 'lt', 'rt', 'tl', 'bl'].includes(position)\n ? 'start'\n : ['topRight', 'bottomRight', 'leftBottom', 'rightBottom', 'lb', 'rb', 'rt', 'br'].includes(position)\n ? 'end'\n : 'middle'\n\n result.legends = {\n type: 'color',\n visible: enable,\n orient,\n position: legendPosition,\n padding: 0,\n field: unfoldInfo.encodingColor,\n maxWidth: '30%',\n startText: {\n visible: true,\n style: {\n fill: labelColor || labelFontColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n },\n },\n endText: {\n visible: true,\n style: {\n fill: labelColor || labelFontColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n },\n },\n }\n return result\n}\n"],"names":["colorLegend","spec","context","result","advancedVSeed","datasetReshapeInfo","chartType","unfoldInfo","baseConfig","legend","enable","position","labelFontColor","labelColor","labelFontSize","labelFontWeight","orient","legendPosition"],"mappings":"AAEO,MAAMA,cAAwB,CAACC,MAAMC;IAC1C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,SAAS,EAAE,GAAGF;IAC1C,MAAM,EAAEG,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAC5C,MAAMG,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAClD,IAAI,CAACE,cAAc,CAACA,WAAW,MAAM,EACnC,OAAOL;IAGT,MAAM,EAAEM,MAAM,EAAE,GAAGD;IACnB,MAAM,EAAEE,MAAM,EAAEC,WAAW,QAAQ,EAAEC,cAAc,EAAEC,UAAU,EAAEC,gBAAgB,EAAE,EAAEC,eAAe,EAAE,GAAGN,UAAU,CAAC;IAEpH,MAAMO,SAAS;QAAC;QAAU;QAAc;QAAe;QAAM;KAAK,CAAC,QAAQ,CAACL,YACxE,WACA;QAAC;QAAO;QAAW;QAAY;QAAM;KAAK,CAAC,QAAQ,CAACA,YAClD,QACA;QAAC;QAAQ;QAAW;QAAc;QAAM;KAAK,CAAC,QAAQ,CAACA,YACrD,SACA;IAER,MAAMM,iBAAiB;QAAC;QAAW;QAAc;QAAW;QAAY;QAAM;QAAM;QAAM;KAAK,CAAC,QAAQ,CAACN,YACrG,UACA;QAAC;QAAY;QAAe;QAAc;QAAe;QAAM;QAAM;QAAM;KAAK,CAAC,QAAQ,CAACA,YACxF,QACA;IAENR,OAAO,OAAO,GAAG;QACf,MAAM;QACN,SAASO;QACTM;QACA,UAAUC;QACV,SAAS;QACT,OAAOV,WAAW,aAAa;QAC/B,UAAU;QACV,WAAW;YACT,SAAS;YACT,OAAO;gBACL,MAAMM,cAAcD;gBACpB,UAAUE;gBACV,YAAYC;YACd;QACF;QACA,SAAS;YACP,SAAS;YACT,OAAO;gBACL,MAAMF,cAAcD;gBACpB,UAAUE;gBACV,YAAYC;YACd;QACF;IACF;IACA,OAAOZ;AACT"}
|
@@ -8,7 +8,7 @@ const discreteLegend = (spec, context)=>{
|
|
8
8
|
const baseConfig = advancedVSeed.config[chartType];
|
9
9
|
if (!baseConfig || !baseConfig.legend) return result;
|
10
10
|
const { legend } = baseConfig;
|
11
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
11
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
12
12
|
const orient = [
|
13
13
|
'bottom',
|
14
14
|
'bottomLeft',
|
@@ -68,7 +68,7 @@ const discreteLegend = (spec, context)=>{
|
|
68
68
|
maxWidth: '30%',
|
69
69
|
focusIconStyle: {
|
70
70
|
size: labelFontSize + 2,
|
71
|
-
fill: labelFontColor,
|
71
|
+
fill: labelColor || labelFontColor,
|
72
72
|
fontWeight: labelFontWeight
|
73
73
|
},
|
74
74
|
shape: {
|
@@ -82,14 +82,14 @@ const discreteLegend = (spec, context)=>{
|
|
82
82
|
formatMethod: (value)=>unfoldInfo.colorIdMap[String(value)] ?? value,
|
83
83
|
style: {
|
84
84
|
fontSize: labelFontSize,
|
85
|
-
fill: labelFontColor,
|
85
|
+
fill: labelColor || labelFontColor,
|
86
86
|
fontWeight: labelFontWeight
|
87
87
|
}
|
88
88
|
},
|
89
89
|
background: {
|
90
90
|
state: {
|
91
91
|
selectedHover: {
|
92
|
-
fill: labelFontColor,
|
92
|
+
fill: labelColor || labelFontColor,
|
93
93
|
fillOpacity: 0.05
|
94
94
|
}
|
95
95
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/legend/discreteLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/discreteLegend.ts"],"sourcesContent":["import type { Legend, SpecPipe } from 'src/types'\n\nexport const discreteLegend: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed } = context\n const { datasetReshapeInfo, chartType } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n const baseConfig = advancedVSeed.config[chartType] as { legend: Legend }\n if (!baseConfig || !baseConfig.legend) {\n return result\n }\n\n const { legend } = baseConfig\n const {\n enable,\n position = 'bottom',\n labelFontColor,\n labelFontSize = 12,\n labelFontWeight,\n maxSize = 1,\n border,\n shapeType = 'rectRound',\n } = legend || {}\n\n const orient = ['bottom', 'bottomLeft', 'bottomRight', 'bl', 'br'].includes(position)\n ? 'bottom'\n : ['top', 'topLeft', 'topRight', 'tl', 'tr'].includes(position)\n ? 'top'\n : ['left', 'leftTop', 'leftBottom', 'lt', 'lb'].includes(position)\n ? 'left'\n : 'right'\n\n const legendPosition = ['topLeft', 'bottomLeft', 'leftTop', 'rightTop', 'lt', 'rt', 'tl', 'bl'].includes(position)\n ? 'start'\n : ['topRight', 'bottomRight', 'leftBottom', 'rightBottom', 'lb', 'rb', 'rt', 'br'].includes(position)\n ? 'end'\n : 'middle'\n\n result.legends = {\n type: 'discrete',\n visible: enable,\n maxCol: Math.max(1, maxSize),\n maxRow: Math.max(1, maxSize),\n autoPage: true,\n orient,\n position: legendPosition,\n data: border\n ? (items) => {\n return items.map((item) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n item.shape.outerBorder = {\n stroke: item.shape.fill,\n distance: 3,\n lineWidth: 1,\n }\n return item\n })\n }\n : undefined,\n item: {\n focus: true,\n maxWidth: '30%',\n focusIconStyle: {\n size: labelFontSize + 2,\n fill: labelFontColor,\n fontWeight: labelFontWeight,\n },\n shape: {\n space: border ? 6 : 4,\n style: {\n symbolType: shapeType,\n size: border ? 8 : 10,\n },\n },\n label: {\n formatMethod: (value) => {\n return unfoldInfo.colorIdMap[String(value)] ?? value\n },\n style: {\n fontSize: labelFontSize,\n fill: labelFontColor,\n fontWeight: labelFontWeight,\n },\n },\n background: {\n state: {\n selectedHover: {\n fill: labelFontColor,\n fillOpacity: 0.05,\n },\n },\n },\n },\n padding: 0,\n }\n return result\n}\n"],"names":["discreteLegend","spec","context","result","advancedVSeed","datasetReshapeInfo","chartType","unfoldInfo","baseConfig","legend","enable","position","labelFontColor","labelFontSize","labelFontWeight","maxSize","border","shapeType","orient","legendPosition","Math","items","item","undefined","value","String"],"mappings":"AAEO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,SAAS,EAAE,GAAGF;IAC1C,MAAM,EAAEG,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAC5C,MAAMG,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAClD,IAAI,CAACE,cAAc,CAACA,WAAW,MAAM,EACnC,OAAOL;IAGT,MAAM,EAAEM,MAAM,EAAE,GAAGD;IACnB,MAAM,EACJE,MAAM,EACNC,WAAW,QAAQ,EACnBC,cAAc,EACdC,gBAAgB,EAAE,EAClBC,eAAe,EACfC,UAAU,CAAC,EACXC,MAAM,EACNC,YAAY,WAAW,EACxB,
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/legend/discreteLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/discreteLegend.ts"],"sourcesContent":["import type { Legend, SpecPipe } from 'src/types'\n\nexport const discreteLegend: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed } = context\n const { datasetReshapeInfo, chartType } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n const baseConfig = advancedVSeed.config[chartType] as { legend: Legend }\n if (!baseConfig || !baseConfig.legend) {\n return result\n }\n\n const { legend } = baseConfig\n const {\n enable,\n position = 'bottom',\n labelFontColor,\n labelColor,\n labelFontSize = 12,\n labelFontWeight,\n maxSize = 1,\n border,\n shapeType = 'rectRound',\n } = legend || {}\n\n const orient = ['bottom', 'bottomLeft', 'bottomRight', 'bl', 'br'].includes(position)\n ? 'bottom'\n : ['top', 'topLeft', 'topRight', 'tl', 'tr'].includes(position)\n ? 'top'\n : ['left', 'leftTop', 'leftBottom', 'lt', 'lb'].includes(position)\n ? 'left'\n : 'right'\n\n const legendPosition = ['topLeft', 'bottomLeft', 'leftTop', 'rightTop', 'lt', 'rt', 'tl', 'bl'].includes(position)\n ? 'start'\n : ['topRight', 'bottomRight', 'leftBottom', 'rightBottom', 'lb', 'rb', 'rt', 'br'].includes(position)\n ? 'end'\n : 'middle'\n\n result.legends = {\n type: 'discrete',\n visible: enable,\n maxCol: Math.max(1, maxSize),\n maxRow: Math.max(1, maxSize),\n autoPage: true,\n orient,\n position: legendPosition,\n data: border\n ? (items) => {\n return items.map((item) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n item.shape.outerBorder = {\n stroke: item.shape.fill,\n distance: 3,\n lineWidth: 1,\n }\n return item\n })\n }\n : undefined,\n item: {\n focus: true,\n maxWidth: '30%',\n focusIconStyle: {\n size: labelFontSize + 2,\n fill: labelColor || labelFontColor,\n fontWeight: labelFontWeight,\n },\n shape: {\n space: border ? 6 : 4,\n style: {\n symbolType: shapeType,\n size: border ? 8 : 10,\n },\n },\n label: {\n formatMethod: (value) => {\n return unfoldInfo.colorIdMap[String(value)] ?? value\n },\n style: {\n fontSize: labelFontSize,\n fill: labelColor || labelFontColor,\n fontWeight: labelFontWeight,\n },\n },\n background: {\n state: {\n selectedHover: {\n fill: labelColor || labelFontColor,\n fillOpacity: 0.05,\n },\n },\n },\n },\n padding: 0,\n }\n return result\n}\n"],"names":["discreteLegend","spec","context","result","advancedVSeed","datasetReshapeInfo","chartType","unfoldInfo","baseConfig","legend","enable","position","labelFontColor","labelColor","labelFontSize","labelFontWeight","maxSize","border","shapeType","orient","legendPosition","Math","items","item","undefined","value","String"],"mappings":"AAEO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,SAAS,EAAE,GAAGF;IAC1C,MAAM,EAAEG,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAC5C,MAAMG,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAClD,IAAI,CAACE,cAAc,CAACA,WAAW,MAAM,EACnC,OAAOL;IAGT,MAAM,EAAEM,MAAM,EAAE,GAAGD;IACnB,MAAM,EACJE,MAAM,EACNC,WAAW,QAAQ,EACnBC,cAAc,EACdC,UAAU,EACVC,gBAAgB,EAAE,EAClBC,eAAe,EACfC,UAAU,CAAC,EACXC,MAAM,EACNC,YAAY,WAAW,EACxB,GAAGT,UAAU,CAAC;IAEf,MAAMU,SAAS;QAAC;QAAU;QAAc;QAAe;QAAM;KAAK,CAAC,QAAQ,CAACR,YACxE,WACA;QAAC;QAAO;QAAW;QAAY;QAAM;KAAK,CAAC,QAAQ,CAACA,YAClD,QACA;QAAC;QAAQ;QAAW;QAAc;QAAM;KAAK,CAAC,QAAQ,CAACA,YACrD,SACA;IAER,MAAMS,iBAAiB;QAAC;QAAW;QAAc;QAAW;QAAY;QAAM;QAAM;QAAM;KAAK,CAAC,QAAQ,CAACT,YACrG,UACA;QAAC;QAAY;QAAe;QAAc;QAAe;QAAM;QAAM;QAAM;KAAK,CAAC,QAAQ,CAACA,YACxF,QACA;IAENR,OAAO,OAAO,GAAG;QACf,MAAM;QACN,SAASO;QACT,QAAQW,KAAK,GAAG,CAAC,GAAGL;QACpB,QAAQK,KAAK,GAAG,CAAC,GAAGL;QACpB,UAAU;QACVG;QACA,UAAUC;QACV,MAAMH,SACF,CAACK,QACQA,MAAM,GAAG,CAAC,CAACC;gBAGhBA,KAAK,KAAK,CAAC,WAAW,GAAG;oBACvB,QAAQA,KAAK,KAAK,CAAC,IAAI;oBACvB,UAAU;oBACV,WAAW;gBACb;gBACA,OAAOA;YACT,KAEFC;QACJ,MAAM;YACJ,OAAO;YACP,UAAU;YACV,gBAAgB;gBACd,MAAMV,gBAAgB;gBACtB,MAAMD,cAAcD;gBACpB,YAAYG;YACd;YACA,OAAO;gBACL,OAAOE,SAAS,IAAI;gBACpB,OAAO;oBACL,YAAYC;oBACZ,MAAMD,SAAS,IAAI;gBACrB;YACF;YACA,OAAO;gBACL,cAAc,CAACQ,QACNlB,WAAW,UAAU,CAACmB,OAAOD,OAAO,IAAIA;gBAEjD,OAAO;oBACL,UAAUX;oBACV,MAAMD,cAAcD;oBACpB,YAAYG;gBACd;YACF;YACA,YAAY;gBACV,OAAO;oBACL,eAAe;wBACb,MAAMF,cAAcD;wBACpB,aAAa;oBACf;gBACF;YACF;QACF;QACA,SAAS;IACX;IACA,OAAOT;AACT"}
|
@@ -11,7 +11,7 @@ const pivotColorLegend = (spec, context)=>{
|
|
11
11
|
const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.statistics.colorMax));
|
12
12
|
const { legend, color } = baseConfig;
|
13
13
|
const { colorScheme, linearColorScheme } = color;
|
14
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400 } = legend || {};
|
14
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight = 400 } = legend || {};
|
15
15
|
const orient = [
|
16
16
|
'bottom',
|
17
17
|
'bottomLeft',
|
@@ -66,7 +66,7 @@ const pivotColorLegend = (spec, context)=>{
|
|
66
66
|
startText: {
|
67
67
|
visible: true,
|
68
68
|
style: {
|
69
|
-
fill: labelFontColor,
|
69
|
+
fill: labelColor || labelFontColor,
|
70
70
|
fontSize: labelFontSize,
|
71
71
|
fontWeight: labelFontWeight
|
72
72
|
}
|
@@ -74,7 +74,7 @@ const pivotColorLegend = (spec, context)=>{
|
|
74
74
|
endText: {
|
75
75
|
visible: true,
|
76
76
|
style: {
|
77
|
-
fill: labelFontColor,
|
77
|
+
fill: labelColor || labelFontColor,
|
78
78
|
fontSize: labelFontSize,
|
79
79
|
fontWeight: labelFontWeight
|
80
80
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/legend/pivotColorLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/pivotColorLegend.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { IColorTableLegendOption } from '@visactor/vtable/es/ts-types/component/legend'\nimport type { Color, Legend, SpecPipe } from 'src/types'\n\nexport const pivotColorLegend: SpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { legend: Legend; color: Color }\n\n if (!baseConfig || !baseConfig.legend) {\n return result\n }\n\n const { datasetReshapeInfo } = advancedVSeed\n const max = Math.max(...datasetReshapeInfo.map((d) => d.foldInfo.statistics.colorMin))\n const min = Math.min(...datasetReshapeInfo.map((d) => d.foldInfo.statistics.colorMax))\n const { legend, color } = baseConfig\n const { colorScheme, linearColorScheme } = color\n\n const {
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/legend/pivotColorLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/pivotColorLegend.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { IColorTableLegendOption } from '@visactor/vtable/es/ts-types/component/legend'\nimport type { Color, Legend, SpecPipe } from 'src/types'\n\nexport const pivotColorLegend: SpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { legend: Legend; color: Color }\n\n if (!baseConfig || !baseConfig.legend) {\n return result\n }\n\n const { datasetReshapeInfo } = advancedVSeed\n const max = Math.max(...datasetReshapeInfo.map((d) => d.foldInfo.statistics.colorMin))\n const min = Math.min(...datasetReshapeInfo.map((d) => d.foldInfo.statistics.colorMax))\n const { legend, color } = baseConfig\n const { colorScheme, linearColorScheme } = color\n\n const {\n enable,\n position = 'bottom',\n labelFontColor,\n labelColor,\n labelFontSize = 12,\n labelFontWeight = 400,\n } = legend || {}\n\n const orient = ['bottom', 'bottomLeft', 'bottomRight', 'bl', 'br'].includes(position)\n ? 'bottom'\n : ['top', 'topLeft', 'topRight', 'tl', 'tr'].includes(position)\n ? 'top'\n : ['left', 'leftTop', 'leftBottom', 'lt', 'lb'].includes(position)\n ? 'left'\n : 'right'\n\n const legendPosition = ['topLeft', 'bottomLeft', 'leftTop', 'rightTop', 'lt', 'rt', 'tl', 'bl'].includes(position)\n ? 'start'\n : ['topRight', 'bottomRight', 'leftBottom', 'rightBottom', 'lb', 'rb', 'rt', 'br'].includes(position)\n ? 'end'\n : 'middle'\n\n const legends: IColorTableLegendOption = {\n visible: enable,\n type: 'color',\n orient,\n position: legendPosition,\n\n colors: linearColorScheme || colorScheme || [],\n value: [min, max],\n min: min,\n max: max,\n\n maxWidth: '30%',\n startText: {\n visible: true,\n style: {\n fill: labelColor || labelFontColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n },\n },\n endText: {\n visible: true,\n style: {\n fill: labelColor || labelFontColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n },\n },\n }\n return { ...result, legends }\n}\n"],"names":["pivotColorLegend","spec","context","result","advancedVSeed","chartType","baseConfig","datasetReshapeInfo","max","Math","d","min","legend","color","colorScheme","linearColorScheme","enable","position","labelFontColor","labelColor","labelFontSize","labelFontWeight","orient","legendPosition","legends"],"mappings":"AAIO,MAAMA,mBAA6B,CAACC,MAAMC;IAC/C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,SAAS,EAAE,GAAGD;IACtB,MAAME,aAAaF,cAAc,MAAM,CAACC,UAAU;IAElD,IAAI,CAACC,cAAc,CAACA,WAAW,MAAM,EACnC,OAAOH;IAGT,MAAM,EAAEI,kBAAkB,EAAE,GAAGH;IAC/B,MAAMI,MAAMC,KAAK,GAAG,IAAIF,mBAAmB,GAAG,CAAC,CAACG,IAAMA,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;IACpF,MAAMC,MAAMF,KAAK,GAAG,IAAIF,mBAAmB,GAAG,CAAC,CAACG,IAAMA,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;IACpF,MAAM,EAAEE,MAAM,EAAEC,KAAK,EAAE,GAAGP;IAC1B,MAAM,EAAEQ,WAAW,EAAEC,iBAAiB,EAAE,GAAGF;IAE3C,MAAM,EACJG,MAAM,EACNC,WAAW,QAAQ,EACnBC,cAAc,EACdC,UAAU,EACVC,gBAAgB,EAAE,EAClBC,kBAAkB,GAAG,EACtB,GAAGT,UAAU,CAAC;IAEf,MAAMU,SAAS;QAAC;QAAU;QAAc;QAAe;QAAM;KAAK,CAAC,QAAQ,CAACL,YACxE,WACA;QAAC;QAAO;QAAW;QAAY;QAAM;KAAK,CAAC,QAAQ,CAACA,YAClD,QACA;QAAC;QAAQ;QAAW;QAAc;QAAM;KAAK,CAAC,QAAQ,CAACA,YACrD,SACA;IAER,MAAMM,iBAAiB;QAAC;QAAW;QAAc;QAAW;QAAY;QAAM;QAAM;QAAM;KAAK,CAAC,QAAQ,CAACN,YACrG,UACA;QAAC;QAAY;QAAe;QAAc;QAAe;QAAM;QAAM;QAAM;KAAK,CAAC,QAAQ,CAACA,YACxF,QACA;IAEN,MAAMO,UAAmC;QACvC,SAASR;QACT,MAAM;QACNM;QACA,UAAUC;QAEV,QAAQR,qBAAqBD,eAAe,EAAE;QAC9C,OAAO;YAACH;YAAKH;SAAI;QACjB,KAAKG;QACL,KAAKH;QAEL,UAAU;QACV,WAAW;YACT,SAAS;YACT,OAAO;gBACL,MAAMW,cAAcD;gBACpB,UAAUE;gBACV,YAAYC;YACd;QACF;QACA,SAAS;YACP,SAAS;YACT,OAAO;gBACL,MAAMF,cAAcD;gBACpB,UAAUE;gBACV,YAAYC;YACd;QACF;IACF;IACA,OAAO;QAAE,GAAGlB,MAAM;QAAEqB;IAAQ;AAC9B"}
|
@@ -17,7 +17,7 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
17
17
|
const { legend, color } = baseConfig;
|
18
18
|
const { colorScheme, colorMapping } = color;
|
19
19
|
const colorSpecified = createSpecifiedForColorMapping(colorMapping, colorIdMap, colorItems);
|
20
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
20
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight = 400, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
21
21
|
const orient = [
|
22
22
|
'bottom',
|
23
23
|
'bottomLeft',
|
@@ -82,7 +82,7 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
82
82
|
maxWidth: '30%',
|
83
83
|
focusIconStyle: {
|
84
84
|
size: labelFontSize + 2,
|
85
|
-
fill: labelFontColor,
|
85
|
+
fill: labelColor || labelFontColor,
|
86
86
|
fontWeight: labelFontWeight
|
87
87
|
},
|
88
88
|
shape: {
|
@@ -96,14 +96,14 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
96
96
|
formatMethod: (value)=>colorIdMap[value] ?? value,
|
97
97
|
style: {
|
98
98
|
fontSize: labelFontSize,
|
99
|
-
fill: labelFontColor,
|
99
|
+
fill: labelColor || labelFontColor,
|
100
100
|
fontWeight: labelFontWeight
|
101
101
|
}
|
102
102
|
},
|
103
103
|
background: {
|
104
104
|
state: {
|
105
105
|
selectedHover: {
|
106
|
-
fill: labelFontColor,
|
106
|
+
fill: labelColor || labelFontColor,
|
107
107
|
fillOpacity: 0.05
|
108
108
|
}
|
109
109
|
}
|