@visactor/vgrammar-plot 0.7.0-alpha.3 → 0.7.1
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/cjs/area.d.ts +2 -2
- package/cjs/area.js +2 -2
- package/cjs/area.js.map +1 -1
- package/cjs/cell.d.ts +2 -2
- package/cjs/cell.js +2 -2
- package/cjs/cell.js.map +1 -1
- package/cjs/circle-packing.d.ts +2 -2
- package/cjs/circle-packing.js +3 -3
- package/cjs/circle-packing.js.map +1 -1
- package/cjs/image.d.ts +2 -2
- package/cjs/image.js +2 -2
- package/cjs/image.js.map +1 -1
- package/cjs/interval.d.ts +2 -2
- package/cjs/interval.js +2 -2
- package/cjs/interval.js.map +1 -1
- package/cjs/line.d.ts +2 -2
- package/cjs/line.js +2 -2
- package/cjs/line.js.map +1 -1
- package/cjs/path.d.ts +2 -2
- package/cjs/path.js +2 -2
- package/cjs/path.js.map +1 -1
- package/cjs/plot.d.ts +23 -23
- package/cjs/plot.js +27 -27
- package/cjs/plot.js.map +1 -1
- package/cjs/polygon.d.ts +2 -2
- package/cjs/polygon.js +2 -2
- package/cjs/polygon.js.map +1 -1
- package/cjs/rect-x.d.ts +2 -2
- package/cjs/rect-x.js +8 -4
- package/cjs/rect-x.js.map +1 -1
- package/cjs/rect-y.d.ts +2 -2
- package/cjs/rect-y.js +8 -4
- package/cjs/rect-y.js.map +1 -1
- package/cjs/rect.d.ts +2 -2
- package/cjs/rect.js +14 -6
- package/cjs/rect.js.map +1 -1
- package/cjs/rule-x.d.ts +2 -2
- package/cjs/rule-x.js +2 -2
- package/cjs/rule-x.js.map +1 -1
- package/cjs/rule-y.d.ts +2 -2
- package/cjs/rule-y.js +2 -2
- package/cjs/rule-y.js.map +1 -1
- package/cjs/rule.d.ts +2 -2
- package/cjs/rule.js +2 -2
- package/cjs/rule.js.map +1 -1
- package/cjs/sankey.d.ts +4 -4
- package/cjs/sankey.js +5 -5
- package/cjs/sankey.js.map +1 -1
- package/cjs/semantic-mark.d.ts +5 -1
- package/cjs/semantic-mark.js +163 -43
- package/cjs/semantic-mark.js.map +1 -1
- package/cjs/sunburst.d.ts +3 -3
- package/cjs/sunburst.js +4 -4
- package/cjs/sunburst.js.map +1 -1
- package/cjs/symbol.d.ts +2 -2
- package/cjs/symbol.js +2 -2
- package/cjs/symbol.js.map +1 -1
- package/cjs/text.d.ts +2 -2
- package/cjs/text.js +2 -2
- package/cjs/text.js.map +1 -1
- package/cjs/tree.d.ts +2 -2
- package/cjs/tree.js +4 -4
- package/cjs/tree.js.map +1 -1
- package/cjs/treemap.d.ts +3 -3
- package/cjs/treemap.js +4 -4
- package/cjs/treemap.js.map +1 -1
- package/cjs/wordcloud-shape.d.ts +2 -2
- package/cjs/wordcloud-shape.js +3 -3
- package/cjs/wordcloud-shape.js.map +1 -1
- package/cjs/wordcloud.d.ts +2 -2
- package/cjs/wordcloud.js +3 -3
- package/cjs/wordcloud.js.map +1 -1
- package/es/area.d.ts +2 -2
- package/es/area.js +1 -1
- package/es/area.js.map +1 -1
- package/es/cell.d.ts +2 -2
- package/es/cell.js +1 -1
- package/es/cell.js.map +1 -1
- package/es/circle-packing.d.ts +2 -2
- package/es/circle-packing.js +2 -2
- package/es/circle-packing.js.map +1 -1
- package/es/image.d.ts +2 -2
- package/es/image.js +1 -1
- package/es/image.js.map +1 -1
- package/es/interval.d.ts +2 -2
- package/es/interval.js +1 -1
- package/es/interval.js.map +1 -1
- package/es/line.d.ts +2 -2
- package/es/line.js +1 -1
- package/es/line.js.map +1 -1
- package/es/path.d.ts +2 -2
- package/es/path.js +1 -1
- package/es/path.js.map +1 -1
- package/es/plot.d.ts +23 -23
- package/es/plot.js +1 -1
- package/es/plot.js.map +1 -1
- package/es/polygon.d.ts +2 -2
- package/es/polygon.js +1 -1
- package/es/polygon.js.map +1 -1
- package/es/rect-x.d.ts +2 -2
- package/es/rect-x.js +9 -3
- package/es/rect-x.js.map +1 -1
- package/es/rect-y.d.ts +2 -2
- package/es/rect-y.js +9 -3
- package/es/rect-y.js.map +1 -1
- package/es/rect.d.ts +2 -2
- package/es/rect.js +15 -5
- package/es/rect.js.map +1 -1
- package/es/rule-x.d.ts +2 -2
- package/es/rule-x.js +1 -1
- package/es/rule-x.js.map +1 -1
- package/es/rule-y.d.ts +2 -2
- package/es/rule-y.js +1 -1
- package/es/rule-y.js.map +1 -1
- package/es/rule.d.ts +2 -2
- package/es/rule.js +1 -1
- package/es/rule.js.map +1 -1
- package/es/sankey.d.ts +4 -4
- package/es/sankey.js +3 -3
- package/es/sankey.js.map +1 -1
- package/es/semantic-mark.d.ts +5 -1
- package/es/semantic-mark.js +137 -18
- package/es/semantic-mark.js.map +1 -1
- package/es/sunburst.d.ts +3 -3
- package/es/sunburst.js +2 -2
- package/es/sunburst.js.map +1 -1
- package/es/symbol.d.ts +2 -2
- package/es/symbol.js +1 -1
- package/es/symbol.js.map +1 -1
- package/es/text.d.ts +2 -2
- package/es/text.js +1 -1
- package/es/text.js.map +1 -1
- package/es/tree.d.ts +2 -2
- package/es/tree.js +3 -3
- package/es/tree.js.map +1 -1
- package/es/treemap.d.ts +3 -3
- package/es/treemap.js +2 -2
- package/es/treemap.js.map +1 -1
- package/es/wordcloud-shape.d.ts +2 -2
- package/es/wordcloud-shape.js +2 -2
- package/es/wordcloud-shape.js.map +1 -1
- package/es/wordcloud.d.ts +2 -2
- package/es/wordcloud.js +2 -2
- package/es/wordcloud.js.map +1 -1
- package/package.json +8 -8
- package/dist/index.js +0 -3448
- package/dist/index.min.js +0 -1
package/cjs/rect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rect.ts"],"names":[],"mappings":";;;AAAA,2DAAoE;AAapE,mDAA+C;AAE/C,
|
|
1
|
+
{"version":3,"sources":["../src/rect.ts"],"names":[],"mappings":";;;AAAA,2DAAoE;AAapE,mDAA+C;AAE/C,2DAA0D;AAC1D,6CAA2C;AAC3C,mCAAsC;AACtC,6CAAgD;A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AAC;YAC3E,CAAC,CAAC;SACH;QAED,IAAI,WAAW,CAAC,MAAM,EAAE;YACtB,GAAG,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;SACjC;QAED,IAAI,WAAW,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK,EAAE;YAC1C,GAAG,CAAC,IAAI,GAAG,MAAA,WAAW,CAAC,KAAK,mCAAI,WAAW,CAAC,KAAK,CAAC;SACnD;aAAM;YACL,GAAG,CAAC,IAAI,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,KAAK,0CAAE,IAAI,mCAAI,MAAA,IAAI,CAAC,UAAU,EAAE,0CAAG,CAAC,CAAC,CAAC;SAC5D;QAED,OAAO,GAAG,CAAC;IACb,CAAC;;AA1HH,4CA2HC;AA1HiB,qBAAI,GAAG,mBAAW,CAAC,IAAI,CAAC","file":"rect.js","sourcesContent":["import { field as getFieldAccessor } from '@visactor/vgrammar-util';\nimport type {\n RectEncodeChannels,\n PlotRectEncoderSpec,\n SemanticTooltipOption,\n WithDefaultEncode,\n GenerateBaseEncodeSpec,\n CrosshairSpec,\n Nil,\n ScaleSpec,\n ValueOf,\n IElement\n} from '@visactor/vgrammar-core';\nimport { SemanticMark } from './semantic-mark';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarMarkType } from '@visactor/vgrammar-core';\nimport { isArray } from '@visactor/vutils';\nimport { PlotMakType } from './enums';\nimport { isContinuous } from '@visactor/vscale';\n\nexport class RectSemanticMark extends SemanticMark<PlotRectEncoderSpec, RectEncodeChannels> {\n static readonly type = PlotMakType.rect;\n constructor(id?: string | number) {\n super(PlotMakType.rect, id);\n }\n\n setMarkType() {\n return GrammarMarkType.rect;\n }\n\n parseScaleByEncode(\n channel: RectEncodeChannels,\n option: ValueOf<WithDefaultEncode<PlotRectEncoderSpec, RectEncodeChannels>, RectEncodeChannels>\n ): ScaleSpec | Nil {\n return this.parseScaleOfCommonEncode(channel, option);\n }\n\n setDefaultCrosshair(): Record<string, Pick<CrosshairSpec, 'crosshairShape' | 'crosshairType'>> {\n return {\n x: { crosshairShape: 'rect' }\n };\n }\n\n setDefaultTooltip(): SemanticTooltipOption | Nil {\n const encodeY = this.spec.encode?.y;\n return {\n content: isArray(encodeY)\n ? encodeY.map(entry => {\n return {\n value: entry\n };\n })\n : [\n {\n value: encodeY\n }\n ]\n };\n }\n\n convertMarkEncode(\n encode: WithDefaultEncode<PlotRectEncoderSpec, RectEncodeChannels>\n ): GenerateBaseEncodeSpec<PlotRectEncoderSpec> {\n const markEncoder = this.convertSimpleMarkEncode(encode);\n const scaleXId = this.getScaleId('x');\n const scaleYId = this.getScaleId('y');\n const res: GenerateBaseEncodeSpec<PlotRectEncoderSpec> = {};\n\n if (isArray(markEncoder.x?.field)) {\n res.x = { field: markEncoder.x.field[0], scale: markEncoder.x.scale };\n res.x1 = { field: markEncoder.x.field[1], scale: markEncoder.x.scale };\n } else {\n const xAccessor = getFieldAccessor(markEncoder.x.field);\n res.x = (datum: any, el: IElement, params: any) => {\n const xVals = xAccessor(datum);\n const scale = params[scaleXId];\n\n return isArray(xVals) ? scale.scale(xVals[0]) : scale.scale(xVals);\n };\n res.x1 = (datum: any, el: IElement, params: any) => {\n const scale = params[scaleXId];\n const xVals = xAccessor(datum);\n\n if (isArray(xVals) && xVals.length > 1) {\n return scale.scale(xVals[1]);\n }\n\n if (isContinuous(scale.type)) {\n const domain = scale.domain();\n const min = Math.min.apply(null, domain);\n const max = Math.max.apply(null, domain);\n const baseValue = min > 0 ? min : max < 0 ? max : 0;\n\n return scale.scale(baseValue);\n }\n\n return scale.scale(xVals) + (scale.bandwidth?.() ?? scale.step?.() ?? 0);\n };\n }\n\n if (isArray(markEncoder.y?.field)) {\n res.y = { field: markEncoder.y.field[0], scale: markEncoder.y.scale };\n res.y1 = { field: markEncoder.y.field[1], scale: markEncoder.y.scale };\n } else {\n const yAccessor = getFieldAccessor(markEncoder.y.field);\n res.y = (datum: any, el: IElement, params: any) => {\n const yVals = yAccessor(datum);\n const scale = params[scaleYId];\n\n return isArray(yVals) ? scale.scale(yVals[0]) : scale.scale(yVals);\n };\n res.y1 = (datum: any, el: IElement, params: any) => {\n const scale = params[scaleYId];\n const yVals = yAccessor(datum);\n\n if (isArray(yVals) && yVals.length > 1) {\n return scale.scale(yVals[1]);\n }\n if (isContinuous(scale.type)) {\n const domain = scale.domain();\n const min = Math.min.apply(null, domain);\n const max = Math.max.apply(null, domain);\n const baseValue = min > 0 ? min : max < 0 ? max : 0;\n\n return scale.scale(baseValue);\n }\n\n return scale.scale(yVals) + (scale.bandwidth?.() ?? scale.step?.() ?? 0);\n };\n }\n\n if (markEncoder.stroke) {\n res.stroke = markEncoder.stroke;\n }\n\n if (markEncoder.color || markEncoder.group) {\n res.fill = markEncoder.color ?? markEncoder.group;\n } else {\n res.fill = this.spec.style?.fill ?? this.getPalette()?.[0];\n }\n\n return res;\n }\n}\n"]}
|
package/cjs/rule-x.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RuleXEncodeChannels, WithDefaultEncode, BasicEncoderSpecMap, GenerateBaseEncodeSpec, Nil, ScaleSpec, ValueOf } from '@visactor/vgrammar';
|
|
1
|
+
import type { RuleXEncodeChannels, WithDefaultEncode, BasicEncoderSpecMap, GenerateBaseEncodeSpec, Nil, ScaleSpec, ValueOf } from '@visactor/vgrammar-core';
|
|
2
2
|
import { SemanticMark } from './semantic-mark';
|
|
3
|
-
import { GrammarMarkType } from '@visactor/vgrammar';
|
|
3
|
+
import { GrammarMarkType } from '@visactor/vgrammar-core';
|
|
4
4
|
import { PlotMakType } from './enums';
|
|
5
5
|
export declare class RuleX extends SemanticMark<BasicEncoderSpecMap['rule'], RuleXEncodeChannels> {
|
|
6
6
|
static readonly type = PlotMakType.ruleX;
|
package/cjs/rule-x.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.RuleX = void 0;
|
|
6
6
|
|
|
7
|
-
const semantic_mark_1 = require("./semantic-mark"),
|
|
7
|
+
const semantic_mark_1 = require("./semantic-mark"), vgrammar_core_1 = require("@visactor/vgrammar-core"), enums_1 = require("./enums");
|
|
8
8
|
|
|
9
9
|
class RuleX extends semantic_mark_1.SemanticMark {
|
|
10
10
|
constructor(id) {
|
|
11
11
|
super(enums_1.PlotMakType.ruleX, id);
|
|
12
12
|
}
|
|
13
13
|
setMarkType() {
|
|
14
|
-
return
|
|
14
|
+
return vgrammar_core_1.GrammarMarkType.rule;
|
|
15
15
|
}
|
|
16
16
|
parseScaleOfEncodeX(option) {
|
|
17
17
|
const res = super.parseScaleOfEncodeX(option);
|
package/cjs/rule-x.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rule-x.ts"],"names":[],"mappings":";;;AAWA,mDAA+C;AAE/C,
|
|
1
|
+
{"version":3,"sources":["../src/rule-x.ts"],"names":[],"mappings":";;;AAWA,mDAA+C;AAE/C,2DAA0D;AAC1D,mCAAsC;AAEtC,MAAa,KAAM,SAAQ,4BAA8D;IAEvF,YAAY,EAAoB;QAC9B,KAAK,CAAC,mBAAW,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,WAAW;QACT,OAAO,+BAAe,CAAC,IAAI,CAAC;IAC9B,CAAC;IAES,mBAAmB,CAC3B,MAAyG;QAEzG,MAAM,GAAG,GAAG,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAE9C,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC;QACnB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,kBAAkB,CAChB,OAA4B,EAC5B,MAAyG;QAEzG,OAAO,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,iBAAiB,CACf,MAA2E;;QAE3E,MAAM,WAAW,GAAG,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEzD,MAAM,GAAG,GAAG;YACV,CAAC,EAAE,WAAW,CAAC,CAAC;YAChB,EAAE,EAAE,WAAW,CAAC,CAAC;YACjB,CAAC,EAAE,CAAC,KAAU,EAAE,EAAY,EAAE,MAAW,EAAE,EAAE;gBAC3C,OAAO,CAAC,CAAC;YACX,CAAC;YACD,EAAE,EAAE,CAAC,KAAU,EAAE,EAAY,EAAE,MAAW,EAAE,EAAE;gBAC5C,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACjC,CAAC;SACkD,CAAC;QAEtD,IAAI,WAAW,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK,EAAE;YAC1C,GAAG,CAAC,MAAM,GAAG,MAAA,WAAW,CAAC,KAAK,mCAAI,WAAW,CAAC,KAAK,CAAC;SACrD;aAAM;YACL,GAAG,CAAC,MAAM,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,KAAK,0CAAE,MAAM,mCAAI,MAAA,IAAI,CAAC,UAAU,EAAE,0CAAG,CAAC,CAAC,CAAC;SAChE;QAED,OAAO,GAAG,CAAC;IACb,CAAC;;AAjDH,sBAkDC;AAjDiB,UAAI,GAAG,mBAAW,CAAC,KAAK,CAAC","file":"rule-x.js","sourcesContent":["import type {\n RuleXEncodeChannels,\n WithDefaultEncode,\n BasicEncoderSpecMap,\n GenerateBaseEncodeSpec,\n GenerateEncoderSpec,\n IElement,\n Nil,\n ScaleSpec,\n ValueOf\n} from '@visactor/vgrammar-core';\nimport { SemanticMark } from './semantic-mark';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarMarkType } from '@visactor/vgrammar-core';\nimport { PlotMakType } from './enums';\n\nexport class RuleX extends SemanticMark<BasicEncoderSpecMap['rule'], RuleXEncodeChannels> {\n static readonly type = PlotMakType.ruleX;\n constructor(id?: string | number) {\n super(PlotMakType.ruleX, id);\n }\n\n setMarkType() {\n return GrammarMarkType.rule;\n }\n\n protected parseScaleOfEncodeX(\n option: ValueOf<WithDefaultEncode<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>, RuleXEncodeChannels>\n ): ScaleSpec | Nil {\n const res = super.parseScaleOfEncodeX(option);\n\n res.type = 'point';\n return res;\n }\n\n parseScaleByEncode(\n channel: RuleXEncodeChannels,\n option: ValueOf<WithDefaultEncode<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>, RuleXEncodeChannels>\n ): ScaleSpec | Nil {\n return this.parseScaleOfCommonEncode(channel, option);\n }\n\n convertMarkEncode(\n encode: WithDefaultEncode<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>\n ): GenerateBaseEncodeSpec<BasicEncoderSpecMap['rule']> {\n const markEncoder = this.convertSimpleMarkEncode(encode);\n\n const res = {\n x: markEncoder.x,\n x1: markEncoder.x,\n y: (datum: any, el: IElement, params: any) => {\n return 0;\n },\n y1: (datum: any, el: IElement, params: any) => {\n return params.viewBox.height();\n }\n } as GenerateEncoderSpec<BasicEncoderSpecMap['rule']>;\n\n if (markEncoder.color || markEncoder.group) {\n res.stroke = markEncoder.color ?? markEncoder.group;\n } else {\n res.stroke = this.spec.style?.stroke ?? this.getPalette()?.[0];\n }\n\n return res;\n }\n}\n"]}
|
package/cjs/rule-y.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RuleYEncodeChannels, WithDefaultEncode, BasicEncoderSpecMap, GenerateBaseEncodeSpec, Nil, ScaleSpec, ValueOf } from '@visactor/vgrammar';
|
|
1
|
+
import type { RuleYEncodeChannels, WithDefaultEncode, BasicEncoderSpecMap, GenerateBaseEncodeSpec, Nil, ScaleSpec, ValueOf } from '@visactor/vgrammar-core';
|
|
2
2
|
import { SemanticMark } from './semantic-mark';
|
|
3
|
-
import { GrammarMarkType } from '@visactor/vgrammar';
|
|
3
|
+
import { GrammarMarkType } from '@visactor/vgrammar-core';
|
|
4
4
|
import { PlotMakType } from './enums';
|
|
5
5
|
export declare class RuleY extends SemanticMark<BasicEncoderSpecMap['rule'], RuleYEncodeChannels> {
|
|
6
6
|
static readonly type = PlotMakType.ruleY;
|
package/cjs/rule-y.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.RuleY = void 0;
|
|
6
6
|
|
|
7
|
-
const semantic_mark_1 = require("./semantic-mark"),
|
|
7
|
+
const semantic_mark_1 = require("./semantic-mark"), vgrammar_core_1 = require("@visactor/vgrammar-core"), enums_1 = require("./enums"), vutils_1 = require("@visactor/vutils");
|
|
8
8
|
|
|
9
9
|
class RuleY extends semantic_mark_1.SemanticMark {
|
|
10
10
|
constructor(id) {
|
|
11
11
|
super(enums_1.PlotMakType.ruleY, id);
|
|
12
12
|
}
|
|
13
13
|
setMarkType() {
|
|
14
|
-
return
|
|
14
|
+
return vgrammar_core_1.GrammarMarkType.rule;
|
|
15
15
|
}
|
|
16
16
|
parseScaleOfEncodeX(option) {
|
|
17
17
|
const res = super.parseScaleOfEncodeX(option);
|
package/cjs/rule-y.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rule-y.ts"],"names":[],"mappings":";;;AAWA,mDAA+C;AAE/C,
|
|
1
|
+
{"version":3,"sources":["../src/rule-y.ts"],"names":[],"mappings":";;;AAWA,mDAA+C;AAE/C,2DAA0D;AAC1D,mCAAsC;AACtC,6CAA2C;AAE3C,MAAa,KAAM,SAAQ,4BAA8D;IAEvF,YAAY,EAAoB;QAC9B,KAAK,CAAC,mBAAW,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,WAAW;QACT,OAAO,+BAAe,CAAC,IAAI,CAAC;IAC9B,CAAC;IAES,mBAAmB,CAC3B,MAAyG;QAEzG,MAAM,GAAG,GAAG,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAE9C,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC;QACnB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,kBAA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K,0CAAE,MAAM,mCAAI,MAAA,IAAI,CAAC,UAAU,EAAE,0CAAG,CAAC,CAAC,CAAC;SAChE;QAED,OAAO,GAAG,CAAC;IACb,CAAC;;AArDH,sBAsDC;AArDiB,UAAI,GAAG,mBAAW,CAAC,KAAK,CAAC","file":"rule-y.js","sourcesContent":["import type {\n RuleYEncodeChannels,\n WithDefaultEncode,\n BasicEncoderSpecMap,\n GenerateBaseEncodeSpec,\n GenerateEncoderSpec,\n IElement,\n Nil,\n ScaleSpec,\n ValueOf\n} from '@visactor/vgrammar-core';\nimport { SemanticMark } from './semantic-mark';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarMarkType } from '@visactor/vgrammar-core';\nimport { PlotMakType } from './enums';\nimport { isArray } from '@visactor/vutils';\n\nexport class RuleY extends SemanticMark<BasicEncoderSpecMap['rule'], RuleYEncodeChannels> {\n static readonly type = PlotMakType.ruleY;\n constructor(id?: string | number) {\n super(PlotMakType.ruleY, id);\n }\n\n setMarkType() {\n return GrammarMarkType.rule;\n }\n\n protected parseScaleOfEncodeX(\n option: ValueOf<WithDefaultEncode<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>, RuleYEncodeChannels>\n ): ScaleSpec | Nil {\n const res = super.parseScaleOfEncodeX(option);\n\n res.type = 'point';\n return res;\n }\n\n parseScaleByEncode(\n channel: RuleYEncodeChannels,\n option: ValueOf<WithDefaultEncode<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>, RuleYEncodeChannels>\n ): ScaleSpec | Nil {\n return this.parseScaleOfCommonEncode(channel, option);\n }\n\n convertMarkEncode(\n encode: WithDefaultEncode<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>\n ): GenerateBaseEncodeSpec<BasicEncoderSpecMap['rule']> {\n const markEncoder = this.convertSimpleMarkEncode(encode);\n\n const res = {\n y: markEncoder.y,\n y1: markEncoder.y,\n x: isArray(markEncoder.x?.field)\n ? { field: markEncoder.x.field[0], scale: markEncoder.x.scale }\n : (datum: any, el: IElement, params: any) => {\n return 0;\n },\n x1: isArray(markEncoder.x?.field)\n ? { field: markEncoder.x.field[1], scale: markEncoder.x.scale }\n : (datum: any, el: IElement, params: any) => {\n return params.viewBox.width();\n }\n } as GenerateEncoderSpec<BasicEncoderSpecMap['rule']>;\n\n if (markEncoder.color || markEncoder.group) {\n res.stroke = markEncoder.color ?? markEncoder.group;\n } else {\n res.stroke = this.spec.style?.stroke ?? this.getPalette()?.[0];\n }\n\n return res;\n }\n}\n"]}
|
package/cjs/rule.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RuleEncodeChannels, WithDefaultEncode, PlotRuleEncoderSpec, GenerateBaseEncodeSpec, Nil, ScaleSpec, ValueOf } from '@visactor/vgrammar';
|
|
1
|
+
import type { RuleEncodeChannels, WithDefaultEncode, PlotRuleEncoderSpec, GenerateBaseEncodeSpec, Nil, ScaleSpec, ValueOf } from '@visactor/vgrammar-core';
|
|
2
2
|
import { SemanticMark } from './semantic-mark';
|
|
3
|
-
import { GrammarMarkType } from '@visactor/vgrammar';
|
|
3
|
+
import { GrammarMarkType } from '@visactor/vgrammar-core';
|
|
4
4
|
import { PlotMakType } from './enums';
|
|
5
5
|
export declare class Rule extends SemanticMark<PlotRuleEncoderSpec, RuleEncodeChannels> {
|
|
6
6
|
static readonly type = PlotMakType.rule;
|
package/cjs/rule.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Rule = void 0;
|
|
6
6
|
|
|
7
|
-
const semantic_mark_1 = require("./semantic-mark"),
|
|
7
|
+
const semantic_mark_1 = require("./semantic-mark"), vgrammar_core_1 = require("@visactor/vgrammar-core"), vutils_1 = require("@visactor/vutils"), enums_1 = require("./enums");
|
|
8
8
|
|
|
9
9
|
class Rule extends semantic_mark_1.SemanticMark {
|
|
10
10
|
constructor(id) {
|
|
11
11
|
super(enums_1.PlotMakType.rule, id);
|
|
12
12
|
}
|
|
13
13
|
setMarkType() {
|
|
14
|
-
return
|
|
14
|
+
return vgrammar_core_1.GrammarMarkType.rule;
|
|
15
15
|
}
|
|
16
16
|
parseScaleOfEncodeX(option) {
|
|
17
17
|
const res = super.parseScaleOfEncodeX(option);
|
package/cjs/rule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rule.ts"],"names":[],"mappings":";;;AAUA,mDAA+C;AAE/C,
|
|
1
|
+
{"version":3,"sources":["../src/rule.ts"],"names":[],"mappings":";;;AAUA,mDAA+C;AAE/C,2DAA0D;AAC1D,6CAA2C;AAC3C,mCAAsC;AAEtC,MAAa,IAAK,SAAQ,4BAAqD;IAE7E,YAAY,EAAoB;QAC9B,KAAK,CAAC,mBAAW,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,WAAW;QACT,OAAO,+BAAe,CAAC,IAAI,CAAC;IAC9B,CAAC;IAES,mBAAmB,CAC3B,MAA+F;QAE/F,MAAM,GAAG,GAAG,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAE9C,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC;QACnB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,kBAAkB,CAChB,OAA2B,EAC3B,MAA+F;QAE/F,OAAO,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,iBAAiB,CACf,MAAkE;;QAElE,MAAM,WAAW,GAAG,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEzD,IAAI,GAA6C,CAAC;QAElD,IAAI,IAAA,gBAAO,EAAC,MAAA,WAAW,CAAC,CAAC,0CAAE,KAAK,CAAC,EAAE;YACjC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAA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\n GenerateBaseEncodeSpec,\n GenerateEncoderSpec,\n Nil,\n ScaleSpec,\n ValueOf\n} from '@visactor/vgrammar-core';\nimport { SemanticMark } from './semantic-mark';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarMarkType } from '@visactor/vgrammar-core';\nimport { isArray } from '@visactor/vutils';\nimport { PlotMakType } from './enums';\n\nexport class Rule extends SemanticMark<PlotRuleEncoderSpec, RuleEncodeChannels> {\n static readonly type = PlotMakType.rule;\n constructor(id?: string | number) {\n super(PlotMakType.rule, id);\n }\n\n setMarkType() {\n return GrammarMarkType.rule;\n }\n\n protected parseScaleOfEncodeX(\n option: ValueOf<WithDefaultEncode<PlotRuleEncoderSpec, RuleEncodeChannels>, RuleEncodeChannels>\n ): ScaleSpec | Nil {\n const res = super.parseScaleOfEncodeX(option);\n\n res.type = 'point';\n return res;\n }\n\n parseScaleByEncode(\n channel: RuleEncodeChannels,\n option: ValueOf<WithDefaultEncode<PlotRuleEncoderSpec, RuleEncodeChannels>, RuleEncodeChannels>\n ): ScaleSpec | Nil {\n return this.parseScaleOfCommonEncode(channel, option);\n }\n\n convertMarkEncode(\n encode: WithDefaultEncode<PlotRuleEncoderSpec, RuleEncodeChannels>\n ): GenerateBaseEncodeSpec<PlotRuleEncoderSpec> {\n const markEncoder = this.convertSimpleMarkEncode(encode);\n\n let res: GenerateEncoderSpec<PlotRuleEncoderSpec>;\n\n if (isArray(markEncoder.x?.field)) {\n res.x = { field: markEncoder.x.field[0], scale: markEncoder.x.scale };\n res.x1 = { field: markEncoder.x.field[1], scale: markEncoder.x.scale };\n } else {\n res.x = res.x1 = markEncoder.x;\n }\n\n if (isArray(markEncoder.y?.field)) {\n res.y = { field: markEncoder.y.field[0], scale: markEncoder.y.scale };\n res.y1 = { field: markEncoder.y.field[1], scale: markEncoder.y.scale };\n } else {\n res.y = res.y1 = markEncoder.y;\n }\n\n if (markEncoder.color || markEncoder.group) {\n res.stroke = markEncoder.color ?? markEncoder.group;\n } else {\n res.stroke = this.spec.style?.stroke ?? this.getPalette()?.[0];\n }\n\n return res;\n }\n}\n"]}
|
package/cjs/sankey.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { SankeyEncodeChannels, WithDefaultEncode, PlotSankeyEncoderSpec, SemanticLabelOption, ChannelEncodeType, DataSpec, GenerateBaseEncodeSpec, Nil, ScaleSpec, ValueOf, TransformSpec, IElement } from '@visactor/vgrammar';
|
|
1
|
+
import type { SankeyEncodeChannels, WithDefaultEncode, PlotSankeyEncoderSpec, SemanticLabelOption, ChannelEncodeType, DataSpec, GenerateBaseEncodeSpec, Nil, ScaleSpec, ValueOf, TransformSpec, IElement } from '@visactor/vgrammar-core';
|
|
2
2
|
import { SemanticMark } from './semantic-mark';
|
|
3
|
-
import { GrammarMarkType } from '@visactor/vgrammar';
|
|
3
|
+
import { GrammarMarkType } from '@visactor/vgrammar-core';
|
|
4
4
|
import { PlotMakType } from './enums';
|
|
5
5
|
import type { ITextAttribute } from '@visactor/vrender';
|
|
6
6
|
export declare class SankeySemanticMark extends SemanticMark<PlotSankeyEncoderSpec, SankeyEncodeChannels> {
|
|
@@ -29,8 +29,8 @@ export declare class SankeySemanticMark extends SemanticMark<PlotSankeyEncoderSp
|
|
|
29
29
|
};
|
|
30
30
|
key: string;
|
|
31
31
|
dependency: string[];
|
|
32
|
-
animation: import("@visactor/vgrammar").MarkAnimationSpec;
|
|
33
|
-
encode: Record<string, Partial<Partial<import("@visactor/vgrammar").LinkPathEncoderSpec>>> & {
|
|
32
|
+
animation: import("@visactor/vgrammar-core").MarkAnimationSpec;
|
|
33
|
+
encode: Record<string, Partial<Partial<import("@visactor/vgrammar-core").LinkPathEncoderSpec>>> & {
|
|
34
34
|
enter: any;
|
|
35
35
|
update: (datum: any, el: IElement, params: any) => {
|
|
36
36
|
direction: string;
|
package/cjs/sankey.js
CHANGED
|
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.SankeySemanticMark = void 0;
|
|
6
6
|
|
|
7
|
-
const semantic_mark_1 = require("./semantic-mark"),
|
|
7
|
+
const semantic_mark_1 = require("./semantic-mark"), vgrammar_core_1 = require("@visactor/vgrammar-core"), enums_1 = require("./enums"), vgrammar_util_1 = require("@visactor/vgrammar-util");
|
|
8
8
|
|
|
9
9
|
class SankeySemanticMark extends semantic_mark_1.SemanticMark {
|
|
10
10
|
constructor(id) {
|
|
11
|
-
super(enums_1.PlotMakType.sankey, id),
|
|
12
|
-
|
|
11
|
+
super(enums_1.PlotMakType.sankey, id), vgrammar_core_1.Factory.getTransform(enums_1.PlotMakType.sankey) || this._logger.error("Please add this line of code: import { registerSankeyTransforms } from '@visactor/vgrammar-sankey'; \n and run registerSankeyTransforms() before use sankey"),
|
|
12
|
+
vgrammar_core_1.Factory.getGlyph("linkPath") || this._logger.error("\n Please add this line of code: import { registerLinkPathGlyph } from '@visactor/vgrammar-core';\n add run registerLinkPathGlyph() before use sankey\n ");
|
|
13
13
|
}
|
|
14
14
|
setMarkType() {
|
|
15
|
-
return
|
|
15
|
+
return vgrammar_core_1.GrammarMarkType.rect;
|
|
16
16
|
}
|
|
17
17
|
setDefaultDataTransform() {
|
|
18
18
|
var _a;
|
|
@@ -105,7 +105,7 @@ class SankeySemanticMark extends semantic_mark_1.SemanticMark {
|
|
|
105
105
|
skipBeforeLayouted: !0
|
|
106
106
|
},
|
|
107
107
|
key: "index",
|
|
108
|
-
dependency: this.viewSpec.scales.map((scale => scale.id)).concat(
|
|
108
|
+
dependency: this.viewSpec.scales.map((scale => scale.id)).concat(vgrammar_core_1.SIGNAL_VIEW_BOX),
|
|
109
109
|
animation: this.convertMarkAnimation(),
|
|
110
110
|
encode: Object.assign({}, this.spec.state, {
|
|
111
111
|
enter: Object.assign({
|
package/cjs/sankey.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sankey.ts"],"names":[],"mappings":";;;AAeA,mDAA+C;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n GenerateBaseEncodeSpec,\n GenerateEncoderSpec,\n Nil,\n ScaleSpec,\n ValueOf,\n TransformSpec,\n IElement\n} from '@visactor/vgrammar-core';\nimport { SemanticMark } from './semantic-mark';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarMarkType, SIGNAL_VIEW_BOX, Factory } from '@visactor/vgrammar-core';\nimport { PlotMakType } from './enums';\nimport { field as getFieldAccessor } from '@visactor/vgrammar-util';\nimport type { ITextAttribute } from '@visactor/vrender';\n\nexport class SankeySemanticMark extends SemanticMark<PlotSankeyEncoderSpec, SankeyEncodeChannels> {\n static readonly type = PlotMakType.sankey;\n constructor(id?: string | number) {\n super(PlotMakType.sankey, id);\n\n if (!Factory.getTransform(PlotMakType.sankey)) {\n this._logger.error(\n `Please add this line of code: import { registerSankeyTransforms } from '@visactor/vgrammar-sankey'; \n and run registerSankeyTransforms() before use sankey`\n );\n }\n\n if (!Factory.getGlyph('linkPath')) {\n this._logger.error(`\n Please add this line of code: import { registerLinkPathGlyph } from '@visactor/vgrammar-core';\n add run registerLinkPathGlyph() before use sankey\n `);\n }\n }\n\n setMarkType() {\n return GrammarMarkType.rect;\n }\n\n setDefaultDataTransform(): TransformSpec[] {\n return [\n {\n type: 'sankey',\n width: { signal: 'viewWidth' },\n height: { signal: 'viewHeight' },\n nodeKey: this.spec.encode?.node\n }\n ];\n }\n\n getDataIdOfLink() {\n return `${this.spec.data?.id ?? this.spec.id}-data-link`;\n }\n\n setMultipleData(): DataSpec[] {\n return [\n {\n id: this.getDataIdOfFiltered(),\n transform: [\n {\n type: 'map',\n all: true,\n callback: (datum: any) => {\n return datum[0].nodes;\n }\n }\n ]\n },\n {\n source: this.getDataIdOfMain(),\n id: this.getDataIdOfLink(),\n transform: [\n {\n type: 'map',\n all: true,\n callback: (datum: any) => {\n // return formatLinkPath(datum[0].links);\n return datum[0].links;\n }\n }\n ]\n }\n ];\n }\n\n parseScaleByEncode(\n channel: SankeyEncodeChannels,\n option: ValueOf<WithDefaultEncode<PlotSankeyEncoderSpec, SankeyEncodeChannels>, SankeyEncodeChannels>\n ): ScaleSpec | Nil {\n if (channel === 'color') {\n return {\n type: 'ordinal',\n id: this.getScaleId('color'),\n domain: {\n data: this.getDataIdOfFiltered(),\n field: option as string\n },\n range: this.getPalette()\n };\n }\n\n return null;\n }\n\n convertMarkEncode(\n encode: WithDefaultEncode<PlotSankeyEncoderSpec, SankeyEncodeChannels>\n ): GenerateBaseEncodeSpec<PlotSankeyEncoderSpec> {\n const markEncoder = this.convertSimpleMarkEncode(encode);\n\n const res: GenerateEncoderSpec<PlotSankeyEncoderSpec> = {\n x: { field: 'x0' },\n x1: { field: 'x1' },\n y: { field: 'y0' },\n y1: { field: 'y1' }\n };\n\n if (markEncoder.stroke) {\n res.stroke = markEncoder.stroke;\n }\n\n if (markEncoder.color) {\n const scaleColorId = this.getScaleId('color');\n const colorAccessor = getFieldAccessor(markEncoder.color.field);\n\n res.fill = (datum: any, el: IElement, params: any) => {\n const scale = params[scaleColorId];\n return scale.scale(colorAccessor(datum?.datum));\n };\n } else {\n res.fill = this.spec.style?.nodeStyle?.fill ?? this.getPalette()?.[0];\n }\n\n return res;\n }\n\n setMainMarkSpec() {\n return { key: 'key' };\n }\n\n protected setLabelTextGetter(\n channel: string,\n option: SemanticLabelOption | boolean\n ): ChannelEncodeType<ITextAttribute['text']> {\n const textGetter = getFieldAccessor(channel);\n return (datum: any, el: IElement, params: any) => {\n return textGetter(datum.datum);\n };\n }\n\n setMultiMarksSpec() {\n // TODO: optimize the default style\n return [\n {\n id: `${this.getMarkId()}-link`,\n type: 'glyph',\n glyphType: 'linkPath',\n from: {\n data: this.getDataIdOfLink()\n },\n layout: {\n position: 'content',\n skipBeforeLayouted: true\n },\n key: 'index',\n dependency: this.viewSpec.scales.map(scale => scale.id).concat(SIGNAL_VIEW_BOX),\n animation: this.convertMarkAnimation(),\n encode: Object.assign({}, this.spec.state, {\n enter: Object.assign(\n {\n backgroundStyle: { fillColor: '#ccc', fillOpacity: 0.2 },\n fillOpacity: 0.8,\n round: true\n },\n this.spec.style?.linkStyle\n ),\n update: (datum: any, el: IElement, params: any) => {\n return {\n direction: datum.vertical ? 'vertical' : 'horizontal',\n x0: datum.x0,\n x1: datum.x1,\n y0: datum.y0,\n y1: datum.y1,\n thickness: datum.thickness,\n fill: this.spec.style?.linkStyle?.fill ?? this.getPalette()?.[0]\n };\n }\n })\n }\n ];\n }\n}\n"]}
|
package/cjs/semantic-mark.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ILogger } from '@visactor/vutils';
|
|
2
|
-
import type { ISemanticMark, ISemanticMarkSpec, ParsedSimpleEncode, WithDefaultEncode, SemanticTooltipOption, SemanticAxisOption, SemanticPlayerOption, SemanticLabelOption, SemanticDataZoomOption, SemanticSliderOption, SemanticLegendOption, SemanticCrosshairOption, CoordinateOption, AxisSpec, CrosshairSpec, DatazoomSpec, DimensionTooltipSpec, LabelSpec, LegendSpec, PlayerSpec, SliderSpec, TooltipSpec, CoordinateSpec, DataSpec, ChannelEncodeType, ScaleSpec, TransformSpec, MarkAnimationSpec, ViewSpec, MarkType, Nil, ValueOf, GenerateBaseEncodeSpec, IAnimationConfig, MarkSpec, MarkRelativeItemSpec, IPlot } from '@visactor/vgrammar';
|
|
2
|
+
import type { ISemanticMark, ISemanticMarkSpec, ParsedSimpleEncode, WithDefaultEncode, SemanticTooltipOption, SemanticAxisOption, SemanticPlayerOption, SemanticLabelOption, SemanticDataZoomOption, SemanticSliderOption, SemanticLegendOption, SemanticCrosshairOption, CoordinateOption, AxisSpec, CrosshairSpec, DatazoomSpec, DimensionTooltipSpec, LabelSpec, LegendSpec, PlayerSpec, SliderSpec, TooltipSpec, CoordinateSpec, DataSpec, ChannelEncodeType, ScaleSpec, TransformSpec, MarkAnimationSpec, ViewSpec, MarkType, Nil, ValueOf, GenerateBaseEncodeSpec, IAnimationConfig, MarkSpec, MarkRelativeItemSpec, IPlot, SemanticGridOption, GridSpec, TitleSpec, SemanticTitleOption } from '@visactor/vgrammar-core';
|
|
3
3
|
import type { ITextAttribute } from '@visactor/vrender';
|
|
4
4
|
export declare abstract class SemanticMark<EncodeSpec, K extends string> implements ISemanticMark<EncodeSpec, K> {
|
|
5
5
|
spec: ISemanticMarkSpec<EncodeSpec, K>;
|
|
@@ -20,6 +20,7 @@ export declare abstract class SemanticMark<EncodeSpec, K extends string> impleme
|
|
|
20
20
|
state(state: string, option: Partial<EncodeSpec>): this;
|
|
21
21
|
animate(state: string, option: IAnimationConfig | IAnimationConfig[]): this;
|
|
22
22
|
axis(channel: string, option?: SemanticAxisOption | boolean, layout?: MarkRelativeItemSpec): this;
|
|
23
|
+
grid(channel: string, option?: SemanticGridOption | boolean): this;
|
|
23
24
|
legend(channel: string, option?: SemanticLegendOption | boolean, layout?: MarkRelativeItemSpec): this;
|
|
24
25
|
crosshair(channel: string, option?: SemanticCrosshairOption | boolean): this;
|
|
25
26
|
tooltip(option: SemanticTooltipOption | boolean): this;
|
|
@@ -27,6 +28,7 @@ export declare abstract class SemanticMark<EncodeSpec, K extends string> impleme
|
|
|
27
28
|
datazoom(channel: string, option?: SemanticDataZoomOption | boolean, layout?: MarkRelativeItemSpec): this;
|
|
28
29
|
label(channel: string, option?: SemanticLabelOption | boolean): this;
|
|
29
30
|
player(data?: any[], option?: SemanticPlayerOption | boolean, layout?: MarkRelativeItemSpec): this;
|
|
31
|
+
title(option: SemanticTitleOption, layout?: MarkRelativeItemSpec): this;
|
|
30
32
|
protected getPalette(): import("@visactor/vrender").IColor[];
|
|
31
33
|
abstract setMarkType(): MarkType;
|
|
32
34
|
abstract parseScaleByEncode(channel: K, option: ValueOf<WithDefaultEncode<EncodeSpec, K>, K>): ScaleSpec | Nil;
|
|
@@ -55,6 +57,7 @@ export declare abstract class SemanticMark<EncodeSpec, K extends string> impleme
|
|
|
55
57
|
protected parseScaleOfCommonEncode(channel: K, option: ValueOf<WithDefaultEncode<EncodeSpec, K>, K>): ScaleSpec | Nil;
|
|
56
58
|
protected setDefaultAxis(): Record<string, Partial<AxisSpec>>;
|
|
57
59
|
protected parseAxisSpec(): AxisSpec[];
|
|
60
|
+
protected parseGridSpec(): GridSpec[];
|
|
58
61
|
protected parseOption<T>(spec: {
|
|
59
62
|
option: T | boolean;
|
|
60
63
|
layout?: MarkRelativeItemSpec;
|
|
@@ -80,6 +83,7 @@ export declare abstract class SemanticMark<EncodeSpec, K extends string> impleme
|
|
|
80
83
|
protected parseLabelSpec(): LabelSpec[];
|
|
81
84
|
protected setDefaultPlayer(): Record<string, Partial<PlayerSpec>>;
|
|
82
85
|
protected parsePlayerSpec(): PlayerSpec[];
|
|
86
|
+
protected parseTitleSpec(): TitleSpec[];
|
|
83
87
|
protected parseDataSpec(): DataSpec[];
|
|
84
88
|
protected parseScaleSpec(): (ScaleSpec & {
|
|
85
89
|
userScale?: ScaleSpec;
|