@pixerate/editor 0.171.0 → 0.172.0
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/README.md +4 -0
- package/dist/agent/index.cjs +28 -28
- package/dist/agent/index.js +3 -3
- package/dist/canvas/index.cjs +3 -3
- package/dist/canvas/index.js +1 -1
- package/dist/chart/index.cjs +156 -68
- package/dist/chart/index.d.cts +1 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart/index.js +91 -3
- package/dist/chart/layout-shared.d.cts +2 -1
- package/dist/chart/layout-shared.d.ts +2 -1
- package/dist/chart/layout.d.cts +5 -0
- package/dist/chart/layout.d.ts +5 -0
- package/dist/chart/tooltip.d.cts +53 -0
- package/dist/chart/tooltip.d.ts +53 -0
- package/dist/chart/types.d.cts +14 -0
- package/dist/chart/types.d.ts +14 -0
- package/dist/{chunk-SBAPXFPB.cjs → chunk-FHNGNL3V.cjs} +44 -44
- package/dist/{chunk-2F4GAZL5.cjs → chunk-GXEC4FS6.cjs} +16 -16
- package/dist/{chunk-T62BRXMS.js → chunk-IMHRN4ZZ.js} +1 -1
- package/dist/{chunk-N3ACT6VJ.js → chunk-KPWG3PSW.js} +1 -1
- package/dist/{chunk-M52UCHVZ.js → chunk-OJQVKJYD.js} +12 -1
- package/dist/{chunk-ZUPP4NKM.js → chunk-R2VHVQVY.js} +2 -2
- package/dist/{chunk-GD34ICEX.cjs → chunk-RLOIEDA3.cjs} +10 -10
- package/dist/{chunk-WOIXNDHV.cjs → chunk-TUXKLM5W.cjs} +13 -2
- package/dist/extensions/index.cjs +5 -5
- package/dist/extensions/index.js +4 -4
- package/dist/index.cjs +10 -10
- package/dist/index.js +4 -4
- package/package.json +112 -12
- package/skills/pixerate-chart/SKILL.md +1 -0
|
@@ -34,7 +34,7 @@ var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkRLOIEDA3cjs = require('./chunk-RLOIEDA3.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var _chunkOUO3DSRTcjs = require('./chunk-OUO3DSRT.cjs');
|
|
@@ -3643,9 +3643,9 @@ function insertImportedDocument(target, content, options = {}) {
|
|
|
3643
3643
|
if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
|
|
3644
3644
|
from = to = _state.Selection.near(state.doc.resolve(from)).from;
|
|
3645
3645
|
}
|
|
3646
|
-
if (htmlSlice &&
|
|
3646
|
+
if (htmlSlice && _chunkRLOIEDA3cjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkRLOIEDA3cjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
|
|
3647
3647
|
const tr2 = state.tr;
|
|
3648
|
-
const end2 =
|
|
3648
|
+
const end2 = _chunkRLOIEDA3cjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
|
|
3649
3649
|
if (end2 !== null) {
|
|
3650
3650
|
if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
|
|
3651
3651
|
view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
|
|
@@ -3822,7 +3822,7 @@ var RichClipboard = _core.Extension.create({
|
|
|
3822
3822
|
const slice = _chunk3AJMR7EGcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
|
|
3823
3823
|
if (!slice) return false;
|
|
3824
3824
|
event.preventDefault();
|
|
3825
|
-
if (
|
|
3825
|
+
if (_chunkRLOIEDA3cjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
|
|
3826
3826
|
view.dispatch(
|
|
3827
3827
|
view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
|
|
3828
3828
|
);
|
|
@@ -4223,7 +4223,7 @@ function createOutlineStore(editor) {
|
|
|
4223
4223
|
if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
|
|
4224
4224
|
const headings = getOutline(editor);
|
|
4225
4225
|
const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _161 => _161(editor, headings), 'optionalAccess', _162 => _162.id]), () => ( null));
|
|
4226
|
-
const sameStructure =
|
|
4226
|
+
const sameStructure = _chunkRLOIEDA3cjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
|
|
4227
4227
|
if (sameStructure && snapshot.activeId === activeId) return snapshot;
|
|
4228
4228
|
return {
|
|
4229
4229
|
headings: sameStructure ? snapshot.headings : headings,
|
|
@@ -4271,7 +4271,7 @@ function navigateToHeading(editor, heading, options = {}) {
|
|
|
4271
4271
|
editor.view.dispatch(tr);
|
|
4272
4272
|
editor.view.focus();
|
|
4273
4273
|
}
|
|
4274
|
-
|
|
4274
|
+
_chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
|
|
4275
4275
|
return true;
|
|
4276
4276
|
}
|
|
4277
4277
|
function assignHeadingIds(state, types, generateId) {
|
|
@@ -4296,11 +4296,11 @@ function assignHeadingIds(state, types, generateId) {
|
|
|
4296
4296
|
}
|
|
4297
4297
|
var Outline = _core.Extension.create({
|
|
4298
4298
|
name: "outline",
|
|
4299
|
-
priority:
|
|
4299
|
+
priority: _chunkRLOIEDA3cjs.STRUCTURE_PRIORITY,
|
|
4300
4300
|
addOptions() {
|
|
4301
4301
|
return {
|
|
4302
4302
|
types: ["heading"],
|
|
4303
|
-
generateId: () =>
|
|
4303
|
+
generateId: () => _chunkRLOIEDA3cjs.generateStructureId.call(void 0, "h"),
|
|
4304
4304
|
onUpdate: void 0
|
|
4305
4305
|
};
|
|
4306
4306
|
},
|
|
@@ -4333,14 +4333,14 @@ var Outline = _core.Extension.create({
|
|
|
4333
4333
|
tr.scrollIntoView();
|
|
4334
4334
|
_optionalChain([view, 'optionalAccess', _169 => _169.focus, 'optionalCall', _170 => _170()]);
|
|
4335
4335
|
}
|
|
4336
|
-
|
|
4336
|
+
_chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4337
4337
|
}
|
|
4338
4338
|
return true;
|
|
4339
4339
|
},
|
|
4340
4340
|
scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
|
|
4341
4341
|
const heading = findHeading(state, id);
|
|
4342
4342
|
if (!heading) return false;
|
|
4343
|
-
if (dispatch)
|
|
4343
|
+
if (dispatch) _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4344
4344
|
return true;
|
|
4345
4345
|
}
|
|
4346
4346
|
};
|
|
@@ -4361,7 +4361,7 @@ var Outline = _core.Extension.create({
|
|
|
4361
4361
|
apply: (tr, prev, _oldState, newState) => {
|
|
4362
4362
|
if (!tr.docChanged) return prev;
|
|
4363
4363
|
const next = computeOutline(newState.doc, types);
|
|
4364
|
-
if (
|
|
4364
|
+
if (_chunkRLOIEDA3cjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
|
|
4365
4365
|
storage.headings = next;
|
|
4366
4366
|
_optionalChain([onUpdate, 'call', _171 => _171(), 'optionalCall', _172 => _172(next)]);
|
|
4367
4367
|
return next;
|
|
@@ -4379,7 +4379,7 @@ var Outline = _core.Extension.create({
|
|
|
4379
4379
|
},
|
|
4380
4380
|
onBeforeCreate() {
|
|
4381
4381
|
const { types, generateId } = this.options;
|
|
4382
|
-
|
|
4382
|
+
_chunkRLOIEDA3cjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
|
|
4383
4383
|
}
|
|
4384
4384
|
});
|
|
4385
4385
|
|
|
@@ -4549,7 +4549,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4549
4549
|
node.attrs.minLevel,
|
|
4550
4550
|
node.attrs.maxLevel
|
|
4551
4551
|
);
|
|
4552
|
-
if (!
|
|
4552
|
+
if (!_chunkRLOIEDA3cjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
|
|
4553
4553
|
tr = _nullishCoalesce(tr, () => ( state.tr));
|
|
4554
4554
|
tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
|
|
4555
4555
|
}
|
|
@@ -4561,7 +4561,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4561
4561
|
}
|
|
4562
4562
|
var TableOfContents = _core.Node.create({
|
|
4563
4563
|
name: "tableOfContents",
|
|
4564
|
-
priority:
|
|
4564
|
+
priority: _chunkRLOIEDA3cjs.STRUCTURE_PRIORITY - 5,
|
|
4565
4565
|
group: "block",
|
|
4566
4566
|
atom: true,
|
|
4567
4567
|
selectable: true,
|
|
@@ -4672,7 +4672,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4672
4672
|
return [
|
|
4673
4673
|
new (0, _state.Plugin)({
|
|
4674
4674
|
key: tableOfContentsPluginKey,
|
|
4675
|
-
state:
|
|
4675
|
+
state: _chunkRLOIEDA3cjs.presenceStateSpec.call(void 0, [this.name]),
|
|
4676
4676
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4677
4677
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
4678
4678
|
if (!tableOfContentsPluginKey.getState(newState)) return null;
|
|
@@ -4696,7 +4696,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4696
4696
|
);
|
|
4697
4697
|
view.focus();
|
|
4698
4698
|
}
|
|
4699
|
-
|
|
4699
|
+
_chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, heading.pos);
|
|
4700
4700
|
return true;
|
|
4701
4701
|
}
|
|
4702
4702
|
}
|
|
@@ -4706,7 +4706,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4706
4706
|
},
|
|
4707
4707
|
onBeforeCreate() {
|
|
4708
4708
|
const { headingTypes } = this.options;
|
|
4709
|
-
|
|
4709
|
+
_chunkRLOIEDA3cjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
|
|
4710
4710
|
}
|
|
4711
4711
|
});
|
|
4712
4712
|
|
|
@@ -4764,7 +4764,7 @@ function syncFootnotes(tr, options = {}) {
|
|
|
4764
4764
|
const listType = schema.nodes[LIST];
|
|
4765
4765
|
const itemType = schema.nodes[ITEM];
|
|
4766
4766
|
if (!listType || !itemType) return false;
|
|
4767
|
-
const generateId = _nullishCoalesce(options.generateId, () => ( (() =>
|
|
4767
|
+
const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkRLOIEDA3cjs.generateStructureId.call(void 0, "fn"))));
|
|
4768
4768
|
const refs = [];
|
|
4769
4769
|
const lists = [];
|
|
4770
4770
|
const existing = /* @__PURE__ */ new Map();
|
|
@@ -4848,7 +4848,7 @@ function findReferences(doc, id) {
|
|
|
4848
4848
|
}
|
|
4849
4849
|
var FootnoteReference = _core.Node.create({
|
|
4850
4850
|
name: REFERENCE,
|
|
4851
|
-
priority:
|
|
4851
|
+
priority: _chunkRLOIEDA3cjs.STRUCTURE_PRIORITY - 5,
|
|
4852
4852
|
group: "inline",
|
|
4853
4853
|
inline: true,
|
|
4854
4854
|
atom: true,
|
|
@@ -4856,7 +4856,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4856
4856
|
addOptions() {
|
|
4857
4857
|
return {
|
|
4858
4858
|
HTMLAttributes: {},
|
|
4859
|
-
generateId: () =>
|
|
4859
|
+
generateId: () => _chunkRLOIEDA3cjs.generateStructureId.call(void 0, "fn")
|
|
4860
4860
|
};
|
|
4861
4861
|
},
|
|
4862
4862
|
addAttributes() {
|
|
@@ -4967,7 +4967,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4967
4967
|
_state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
|
|
4968
4968
|
);
|
|
4969
4969
|
tr.scrollIntoView();
|
|
4970
|
-
|
|
4970
|
+
_chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, footnote.pos);
|
|
4971
4971
|
}
|
|
4972
4972
|
return true;
|
|
4973
4973
|
},
|
|
@@ -4977,7 +4977,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4977
4977
|
if (dispatch) {
|
|
4978
4978
|
tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
|
|
4979
4979
|
tr.scrollIntoView();
|
|
4980
|
-
|
|
4980
|
+
_chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, ref.pos);
|
|
4981
4981
|
}
|
|
4982
4982
|
return true;
|
|
4983
4983
|
}
|
|
@@ -4989,7 +4989,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4989
4989
|
return [
|
|
4990
4990
|
new (0, _state.Plugin)({
|
|
4991
4991
|
key: footnotesPluginKey,
|
|
4992
|
-
state:
|
|
4992
|
+
state: _chunkRLOIEDA3cjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
|
|
4993
4993
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4994
4994
|
if (!transactions.some((tr2) => tr2.docChanged)) return null;
|
|
4995
4995
|
if (!footnotesPluginKey.getState(newState)) return null;
|
|
@@ -5010,7 +5010,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
5010
5010
|
},
|
|
5011
5011
|
onBeforeCreate() {
|
|
5012
5012
|
const { generateId } = this.options;
|
|
5013
|
-
|
|
5013
|
+
_chunkRLOIEDA3cjs.syncInitialContent.call(void 0, this.editor, (state) => {
|
|
5014
5014
|
const tr = state.tr;
|
|
5015
5015
|
return syncFootnotes(tr, { generateId }) ? tr : null;
|
|
5016
5016
|
});
|
|
@@ -5150,7 +5150,7 @@ var Bookmark = _core.Mark.create({
|
|
|
5150
5150
|
addOptions() {
|
|
5151
5151
|
return {
|
|
5152
5152
|
HTMLAttributes: {},
|
|
5153
|
-
generateId: () =>
|
|
5153
|
+
generateId: () => _chunkRLOIEDA3cjs.generateStructureId.call(void 0, "bm")
|
|
5154
5154
|
};
|
|
5155
5155
|
},
|
|
5156
5156
|
addAttributes() {
|
|
@@ -5235,7 +5235,7 @@ var Bookmark = _core.Mark.create({
|
|
|
5235
5235
|
tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
|
|
5236
5236
|
tr.scrollIntoView();
|
|
5237
5237
|
const domPos = state.doc.resolve(bookmark.from);
|
|
5238
|
-
|
|
5238
|
+
_chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
|
|
5239
5239
|
}
|
|
5240
5240
|
return true;
|
|
5241
5241
|
}
|
|
@@ -5300,7 +5300,7 @@ function syncCrossReferences(state, headingTypes) {
|
|
|
5300
5300
|
}
|
|
5301
5301
|
var CrossReference = _core.Node.create({
|
|
5302
5302
|
name: NAME,
|
|
5303
|
-
priority:
|
|
5303
|
+
priority: _chunkRLOIEDA3cjs.STRUCTURE_PRIORITY - 5,
|
|
5304
5304
|
group: "inline",
|
|
5305
5305
|
inline: true,
|
|
5306
5306
|
atom: true,
|
|
@@ -5402,7 +5402,7 @@ var CrossReference = _core.Node.create({
|
|
|
5402
5402
|
if (dispatch) {
|
|
5403
5403
|
tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
|
|
5404
5404
|
tr.scrollIntoView();
|
|
5405
|
-
|
|
5405
|
+
_chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, range.blockPos);
|
|
5406
5406
|
}
|
|
5407
5407
|
return true;
|
|
5408
5408
|
}
|
|
@@ -5414,7 +5414,7 @@ var CrossReference = _core.Node.create({
|
|
|
5414
5414
|
return [
|
|
5415
5415
|
new (0, _state.Plugin)({
|
|
5416
5416
|
key: crossReferencePluginKey,
|
|
5417
|
-
state:
|
|
5417
|
+
state: _chunkRLOIEDA3cjs.presenceStateSpec.call(void 0, [NAME]),
|
|
5418
5418
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
5419
5419
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
5420
5420
|
if (!crossReferencePluginKey.getState(newState)) return null;
|
|
@@ -5433,7 +5433,7 @@ var CrossReference = _core.Node.create({
|
|
|
5433
5433
|
},
|
|
5434
5434
|
onBeforeCreate() {
|
|
5435
5435
|
const { headingTypes } = this.options;
|
|
5436
|
-
|
|
5436
|
+
_chunkRLOIEDA3cjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
|
|
5437
5437
|
}
|
|
5438
5438
|
});
|
|
5439
5439
|
|
|
@@ -5688,7 +5688,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5688
5688
|
if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
|
|
5689
5689
|
if (dispatch) {
|
|
5690
5690
|
_history.closeHistory.call(void 0, tr);
|
|
5691
|
-
const [end] =
|
|
5691
|
+
const [end] = _chunkRLOIEDA3cjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
|
|
5692
5692
|
tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
|
|
5693
5693
|
meta(tr, { type: "replaced", anchor: end, count: 1 });
|
|
5694
5694
|
}
|
|
@@ -5699,7 +5699,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5699
5699
|
if (!s || !s.active || !s.matches.length) return false;
|
|
5700
5700
|
if (dispatch) {
|
|
5701
5701
|
_history.closeHistory.call(void 0, tr);
|
|
5702
|
-
const ends =
|
|
5702
|
+
const ends = _chunkRLOIEDA3cjs.applyReplacements.call(void 0, tr, s.matches);
|
|
5703
5703
|
meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
|
|
5704
5704
|
}
|
|
5705
5705
|
return true;
|
|
@@ -5731,7 +5731,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5731
5731
|
if (!s.active || !s.query) {
|
|
5732
5732
|
return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
|
|
5733
5733
|
}
|
|
5734
|
-
const result =
|
|
5734
|
+
const result = _chunkRLOIEDA3cjs.searchDocument.call(void 0, doc, s.query, s.options, {
|
|
5735
5735
|
replacement: s.replacement,
|
|
5736
5736
|
clipboardText: safeClipboard(options.getClipboardText),
|
|
5737
5737
|
timeLimitMs: options.timeLimitMs,
|
|
@@ -6318,7 +6318,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6318
6318
|
})
|
|
6319
6319
|
];
|
|
6320
6320
|
if (options.table !== false) {
|
|
6321
|
-
extensions2.push(...
|
|
6321
|
+
extensions2.push(..._chunkRLOIEDA3cjs.createTableExtensions.call(void 0, optionObject(options.table)));
|
|
6322
6322
|
}
|
|
6323
6323
|
if (characterLimit) {
|
|
6324
6324
|
extensions2.push(
|
|
@@ -6425,8 +6425,8 @@ function createRichTextPreset(options = {}) {
|
|
|
6425
6425
|
}
|
|
6426
6426
|
if (options.chart) {
|
|
6427
6427
|
const { sparkline = true, ...chartOptions } = optionObject(options.chart);
|
|
6428
|
-
extensions2.push(
|
|
6429
|
-
if (sparkline) extensions2.push(
|
|
6428
|
+
extensions2.push(_chunkRLOIEDA3cjs.Chart.configure(chartOptions));
|
|
6429
|
+
if (sparkline) extensions2.push(_chunkRLOIEDA3cjs.Sparkline.configure(optionObject(sparkline)));
|
|
6430
6430
|
}
|
|
6431
6431
|
if (options.paragraphStyles) {
|
|
6432
6432
|
extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
|
|
@@ -6567,7 +6567,7 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6567
6567
|
];
|
|
6568
6568
|
}
|
|
6569
6569
|
function validateFindPattern(query, options = {}) {
|
|
6570
|
-
const result =
|
|
6570
|
+
const result = _chunkRLOIEDA3cjs.compileFindPattern.call(void 0, query, options);
|
|
6571
6571
|
return result.ok ? null : result.error;
|
|
6572
6572
|
}
|
|
6573
6573
|
|
|
@@ -6576,8 +6576,8 @@ var PARAMS = {
|
|
|
6576
6576
|
insertTable: {
|
|
6577
6577
|
type: "object",
|
|
6578
6578
|
properties: {
|
|
6579
|
-
rows: { type: "integer", minimum: 1, maximum:
|
|
6580
|
-
cols: { type: "integer", minimum: 1, maximum:
|
|
6579
|
+
rows: { type: "integer", minimum: 1, maximum: _chunkRLOIEDA3cjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
|
|
6580
|
+
cols: { type: "integer", minimum: 1, maximum: _chunkRLOIEDA3cjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
|
|
6581
6581
|
withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
|
|
6582
6582
|
},
|
|
6583
6583
|
additionalProperties: false
|
|
@@ -6608,7 +6608,7 @@ function createTableCommands(editor, options = {}) {
|
|
|
6608
6608
|
const group = _nullishCoalesce(options.group, () => ( "Table"));
|
|
6609
6609
|
const scope = options.scope ? { scope: options.scope } : {};
|
|
6610
6610
|
const focus = _nullishCoalesce(options.focus, () => ( true));
|
|
6611
|
-
return
|
|
6611
|
+
return _chunkRLOIEDA3cjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
|
|
6612
6612
|
const params = PARAMS[action];
|
|
6613
6613
|
return {
|
|
6614
6614
|
id: `${prefix}${action}`,
|
|
@@ -6618,13 +6618,13 @@ function createTableCommands(editor, options = {}) {
|
|
|
6618
6618
|
description,
|
|
6619
6619
|
...params ? { params } : {},
|
|
6620
6620
|
...scope,
|
|
6621
|
-
enabled: (_ctx, p) =>
|
|
6621
|
+
enabled: (_ctx, p) => _chunkRLOIEDA3cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
|
|
6622
6622
|
run: (_ctx, p) => {
|
|
6623
|
-
if (!
|
|
6624
|
-
const reason =
|
|
6623
|
+
if (!_chunkRLOIEDA3cjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
|
|
6624
|
+
const reason = _chunkRLOIEDA3cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
|
|
6625
6625
|
throw new Error(reason === true ? `${label} did not change the document.` : reason);
|
|
6626
6626
|
}
|
|
6627
|
-
const state =
|
|
6627
|
+
const state = _chunkRLOIEDA3cjs.getTableState.call(void 0, editor);
|
|
6628
6628
|
return {
|
|
6629
6629
|
done: true,
|
|
6630
6630
|
table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
|
|
@@ -14,7 +14,7 @@ var _chunkTTCJPX4Ucjs = require('./chunk-TTCJPX4U.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkTUXKLM5Wcjs = require('./chunk-TUXKLM5W.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -512,9 +512,9 @@ function findMermaidCharts(text) {
|
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
// src/chart/summary.ts
|
|
515
|
-
function summarizeChart(spec, size = { width: 640, height: 400 }, scene =
|
|
515
|
+
function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunkTUXKLM5Wcjs.layoutChart.call(void 0, spec, { ...size, selection: null })) {
|
|
516
516
|
const visible = spec.series.filter((s) => !s.hidden);
|
|
517
|
-
const series = visible.map((s) =>
|
|
517
|
+
const series = visible.map((s) => _chunkTUXKLM5Wcjs.summarizeChartSeries.call(void 0, s, spec.categories));
|
|
518
518
|
const colors = _chunkOUO3DSRTcjs.chartSpecColorsByCategory.call(void 0, spec) ? spec.categories.map((_, i) => _optionalChain([visible, 'access', _24 => _24[0], 'optionalAccess', _25 => _25.pointColors, 'optionalAccess', _26 => _26[i]]) || _chunkOUO3DSRTcjs.chartSliceColor.call(void 0, spec, i)) : visible.map((s) => _chunkOUO3DSRTcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s)));
|
|
519
519
|
const check = _chunkOUO3DSRTcjs.checkChartColors.call(void 0, colors, { surface: scene.theme.surface.startsWith("var(") ? "#ffffff" : scene.theme.surface });
|
|
520
520
|
const axis = (s, a) => s ? { min: s.domain[0], max: s.domain[1], ticks: [...s.ticks], ...s.logBase ? { logBase: s.logBase } : {}, ...a.reverse ? { reversed: true } : {} } : void 0;
|
|
@@ -531,12 +531,12 @@ function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunk
|
|
|
531
531
|
description: describeChart(spec, series)
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((s) =>
|
|
534
|
+
function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((s) => _chunkTUXKLM5Wcjs.summarizeChartSeries.call(void 0, s, spec.categories))) {
|
|
535
535
|
const kind = _chunkOUO3DSRTcjs.CHART_TYPE_LABELS[spec.type].toLowerCase();
|
|
536
536
|
const parts = [];
|
|
537
537
|
const family = _chunkOUO3DSRTcjs.chartFamily.call(void 0, spec);
|
|
538
538
|
const format = spec.yAxis.format;
|
|
539
|
-
const fmt = (v) => v === null ? "blank" :
|
|
539
|
+
const fmt = (v) => v === null ? "blank" : _chunkTUXKLM5Wcjs.formatChartNumber.call(void 0, v, format);
|
|
540
540
|
const head = spec.title ? `${spec.title}: a ${kind} chart` : `A ${kind} chart`;
|
|
541
541
|
if (!series.length || series.every((s) => s.count === 0)) return `${head} with no data.`;
|
|
542
542
|
if (family === "pie" || family === "funnel" || family === "treemap" || family === "sunburst") {
|
|
@@ -554,8 +554,8 @@ function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((
|
|
|
554
554
|
}
|
|
555
555
|
if (family === "choropleth") {
|
|
556
556
|
const s = spec.series.find((x) => !x.hidden);
|
|
557
|
-
const map =
|
|
558
|
-
const matches = map ?
|
|
557
|
+
const map = _chunkTUXKLM5Wcjs.getChartMap.call(void 0, spec.map);
|
|
558
|
+
const matches = map ? _chunkTUXKLM5Wcjs.matchChartMapRegions.call(void 0, map, spec.categories) : spec.categories.map(() => null);
|
|
559
559
|
const rows = spec.categories.flatMap((c, i) => matches[i] && s.values[i] !== null ? [{ name: matches[i].name, v: s.values[i] }] : []).sort((a, b) => b.v - a.v);
|
|
560
560
|
const missing = spec.categories.filter((_, i) => !matches[i]).length;
|
|
561
561
|
if (!rows.length) return `${head} of ${_nullishCoalesce(_optionalChain([map, 'optionalAccess', _27 => _27.name]), () => ( spec.map))} with no regions matched.`;
|
|
@@ -563,8 +563,8 @@ function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((
|
|
|
563
563
|
}
|
|
564
564
|
if (family === "barrace") {
|
|
565
565
|
const n = spec.categories.length;
|
|
566
|
-
const first =
|
|
567
|
-
const last =
|
|
566
|
+
const first = _chunkTUXKLM5Wcjs.chartRaceRanking.call(void 0, spec, 0)[0];
|
|
567
|
+
const last = _chunkTUXKLM5Wcjs.chartRaceRanking.call(void 0, spec, n - 1)[0];
|
|
568
568
|
const lead = (e, at) => e ? `${e.name} leads at ${at} with ${fmt(e.value)}` : "";
|
|
569
569
|
return `${head} of ${series.length} names over ${n} time points (${spec.categories[0]} to ${spec.categories[n - 1]}), showing the top ${Math.min(spec.raceTopN, series.length)}. ${lead(first, spec.categories[0])}; ${lead(last, spec.categories[n - 1])}.`;
|
|
570
570
|
}
|
|
@@ -709,7 +709,7 @@ function chartSceneToSvg(scene, options = {}) {
|
|
|
709
709
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${scene.width}" height="${scene.height}" viewBox="0 0 ${scene.width} ${scene.height}" role="img"${label ? ` aria-label="${escape(label)}"` : ""}${labelled ? ` aria-labelledby="${labelled}"` : ""}>${head}${body}</svg>`;
|
|
710
710
|
}
|
|
711
711
|
function chartToSvg(spec, options) {
|
|
712
|
-
const scene =
|
|
712
|
+
const scene = _chunkTUXKLM5Wcjs.layoutChart.call(void 0, spec, { ...options, selection: null });
|
|
713
713
|
return chartSceneToSvg(scene, { ...options, ariaLabel: _nullishCoalesce(options.ariaLabel, () => ( (spec.title || void 0))), description: _nullishCoalesce(options.description, () => ( describeChart(spec))) });
|
|
714
714
|
}
|
|
715
715
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -933,7 +933,7 @@ var ChartController = (_class = class {
|
|
|
933
933
|
const hadIssues = this.issues.length > 0;
|
|
934
934
|
this.issues = [];
|
|
935
935
|
if (sameChartJson(before, next)) {
|
|
936
|
-
const reselect = select !== void 0 && !
|
|
936
|
+
const reselect = select !== void 0 && !_chunkTUXKLM5Wcjs.sameChartSelection.call(void 0, this.selection, select) && !(select === null && this.selection === null);
|
|
937
937
|
if (reselect) this.selection = select;
|
|
938
938
|
if (reselect || hadIssues) this.notify(false);
|
|
939
939
|
return;
|
|
@@ -1591,7 +1591,7 @@ var ChartController = (_class = class {
|
|
|
1591
1591
|
addTrendline(seriesId, input) {
|
|
1592
1592
|
const series = this.getSeries(seriesId);
|
|
1593
1593
|
if (!series) return this.unknownSeries(seriesId);
|
|
1594
|
-
if (!
|
|
1594
|
+
if (!_chunkTUXKLM5Wcjs.chartSupportsTrendlines.call(void 0, this.spec.type, this.spec.stacking))
|
|
1595
1595
|
return this.reject(`Trendlines need an unstacked bar, line, area, scatter or bubble chart; this is a ${this.spec.stacking !== "none" ? `${this.spec.stacking} ` : ""}${this.spec.type} chart.`);
|
|
1596
1596
|
const issues = [];
|
|
1597
1597
|
const line = _chunkOUO3DSRTcjs.normalizeChartTrendline.call(void 0, input, "trendline", issues);
|
|
@@ -1653,13 +1653,13 @@ var ChartController = (_class = class {
|
|
|
1653
1653
|
trendlineFit(seriesId, index) {
|
|
1654
1654
|
const line = _optionalChain([this, 'access', _81 => _81.getSeries, 'call', _82 => _82(seriesId), 'optionalAccess', _83 => _83.trendlines, 'optionalAccess', _84 => _84[index]]);
|
|
1655
1655
|
if (!line) return null;
|
|
1656
|
-
return
|
|
1656
|
+
return _chunkTUXKLM5Wcjs.fitChartTrendline.call(void 0, line, this.trendlinePoints(seriesId));
|
|
1657
1657
|
}
|
|
1658
1658
|
/** The moving-average points of a trendline (empty for other kinds). */
|
|
1659
1659
|
trendlineMovingAverage(seriesId, index) {
|
|
1660
1660
|
const line = _optionalChain([this, 'access', _85 => _85.getSeries, 'call', _86 => _86(seriesId), 'optionalAccess', _87 => _87.trendlines, 'optionalAccess', _88 => _88[index]]);
|
|
1661
1661
|
if (!line || line.type !== "moving-average") return [];
|
|
1662
|
-
return
|
|
1662
|
+
return _chunkTUXKLM5Wcjs.chartMovingAverage.call(void 0, this.trendlinePoints(seriesId), _nullishCoalesce(line.period, () => ( 2)));
|
|
1663
1663
|
}
|
|
1664
1664
|
// -------------------------------------------------------------------------
|
|
1665
1665
|
// Reshaping
|
|
@@ -1739,7 +1739,7 @@ var ChartController = (_class = class {
|
|
|
1739
1739
|
/** Selects a chart element (view state; not an undo step). */
|
|
1740
1740
|
select(selection) {
|
|
1741
1741
|
const next = this.validSelection(selection, this.spec);
|
|
1742
|
-
if (
|
|
1742
|
+
if (_chunkTUXKLM5Wcjs.sameChartSelection.call(void 0, next, this.selection) || next === null && this.selection === null) return;
|
|
1743
1743
|
this.selection = next;
|
|
1744
1744
|
this.notify(false);
|
|
1745
1745
|
}
|
|
@@ -1958,7 +1958,7 @@ function layoutSparkline(values, options) {
|
|
|
1958
1958
|
const flush = () => {
|
|
1959
1959
|
if (run.length >= 2) {
|
|
1960
1960
|
const pts = run.length > 4e3 ? run.filter((_, i) => i % (Math.floor(run.length / 2e3) + 1) === 0) : run;
|
|
1961
|
-
d += pts.map(([x, y], i) => `${i ? "L" : "M"}${
|
|
1961
|
+
d += pts.map(([x, y], i) => `${i ? "L" : "M"}${_chunkTUXKLM5Wcjs.r2.call(void 0, x)},${_chunkTUXKLM5Wcjs.r2.call(void 0, y)}`).join("");
|
|
1962
1962
|
}
|
|
1963
1963
|
run = [];
|
|
1964
1964
|
};
|
|
@@ -1503,6 +1503,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1503
1503
|
plot,
|
|
1504
1504
|
valueScale: toValueScale(frame.value, horizontal ? "x" : "y"),
|
|
1505
1505
|
...frame.value2 ? { valueScale2: toValueScale(frame.value2, horizontal ? "x" : "y") } : {},
|
|
1506
|
+
categoryScale: { axis: horizontal ? "y" : "x", start: catStart, length: frame.catLen, count: frame.n, reverse: !!spec.xAxis.reverse },
|
|
1506
1507
|
percent
|
|
1507
1508
|
};
|
|
1508
1509
|
}
|
|
@@ -2732,7 +2733,8 @@ function layoutChart(spec, options) {
|
|
|
2732
2733
|
warnings,
|
|
2733
2734
|
...result.valueScale ? { valueScale: result.valueScale } : {},
|
|
2734
2735
|
...result.valueScale2 ? { valueScale2: result.valueScale2 } : {},
|
|
2735
|
-
...result.xScale ? { xScale: result.xScale } : {}
|
|
2736
|
+
...result.xScale ? { xScale: result.xScale } : {},
|
|
2737
|
+
...result.categoryScale ? { categoryScale: result.categoryScale } : {}
|
|
2736
2738
|
};
|
|
2737
2739
|
};
|
|
2738
2740
|
const empty = (message) => {
|
|
@@ -2935,6 +2937,14 @@ function chartValueAtPoint(scene, point, secondary = false) {
|
|
|
2935
2937
|
const px = scale.axis === "y" ? point.y : point.x;
|
|
2936
2938
|
return chartScaleFromPixel(px, scale);
|
|
2937
2939
|
}
|
|
2940
|
+
function chartCategoryAtPoint(scene, point) {
|
|
2941
|
+
const scale = scene.categoryScale;
|
|
2942
|
+
const { plot } = scene;
|
|
2943
|
+
if (!scale || point.x < plot.x || point.x > plot.x + plot.width || point.y < plot.y || point.y > plot.y + plot.height) return void 0;
|
|
2944
|
+
const offset = (scale.axis === "x" ? point.x : point.y) - scale.start;
|
|
2945
|
+
const k = Math.min(scale.count - 1, Math.max(0, Math.floor(offset / scale.length * scale.count)));
|
|
2946
|
+
return scale.reverse ? scale.count - 1 - k : k;
|
|
2947
|
+
}
|
|
2938
2948
|
function chartXAtPoint(scene, point) {
|
|
2939
2949
|
const scale = scene.xScale;
|
|
2940
2950
|
if (!scale) return void 0;
|
|
@@ -2996,6 +3006,7 @@ export {
|
|
|
2996
3006
|
chartRaceRanking,
|
|
2997
3007
|
layoutChart,
|
|
2998
3008
|
chartValueAtPoint,
|
|
3009
|
+
chartCategoryAtPoint,
|
|
2999
3010
|
chartXAtPoint,
|
|
3000
3011
|
snapChartValue
|
|
3001
3012
|
};
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
chartToMermaid,
|
|
6
6
|
describeChart,
|
|
7
7
|
layoutSparkline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KPWG3PSW.js";
|
|
9
9
|
import {
|
|
10
10
|
layoutChart
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OJQVKJYD.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_CHART_THEME,
|
|
14
14
|
normalizeChartSpec
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkGXEC4FS6cjs = require('./chunk-GXEC4FS6.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkTUXKLM5Wcjs = require('./chunk-TUXKLM5W.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -1211,7 +1211,7 @@ var ChartNodeView = (_class = class {
|
|
|
1211
1211
|
this.dom.contentEditable = "false";
|
|
1212
1212
|
this.syncAttributes();
|
|
1213
1213
|
this.key = specKey(this.node.attrs.spec);
|
|
1214
|
-
this.controller = new (0,
|
|
1214
|
+
this.controller = new (0, _chunkGXEC4FS6cjs.ChartController)({ spec: this.node.attrs.spec });
|
|
1215
1215
|
this.unsubscribe = this.controller.subscribe((state) => {
|
|
1216
1216
|
if (!state.gesture) this.writeBack();
|
|
1217
1217
|
});
|
|
@@ -1470,10 +1470,10 @@ function staticChartSvg(node, options) {
|
|
|
1470
1470
|
const spec = node.attrs.spec;
|
|
1471
1471
|
const width = _nullishCoalesce(node.attrs.width, () => ( options.defaultWidth));
|
|
1472
1472
|
const height = _nullishCoalesce(node.attrs.height, () => ( options.defaultHeight));
|
|
1473
|
-
const scene =
|
|
1474
|
-
return
|
|
1473
|
+
const scene = _chunkTUXKLM5Wcjs.layoutChart.call(void 0, spec, { width, height, theme: options.theme, selection: null });
|
|
1474
|
+
return _chunkGXEC4FS6cjs.chartSceneToDomSpec.call(void 0, scene, {
|
|
1475
1475
|
ariaLabel: spec.title || "Chart",
|
|
1476
|
-
description:
|
|
1476
|
+
description: _chunkGXEC4FS6cjs.describeChart.call(void 0, spec),
|
|
1477
1477
|
attrs: { style: "max-width: 100%; height: auto; display: block" }
|
|
1478
1478
|
});
|
|
1479
1479
|
}
|
|
@@ -1541,7 +1541,7 @@ var Chart = _core.Node.create({
|
|
|
1541
1541
|
const code = element.querySelector("code");
|
|
1542
1542
|
const language = _nullishCoalesce(_nullishCoalesce(_optionalChain([code, 'optionalAccess', _34 => _34.getAttribute, 'call', _35 => _35("class")]), () => ( element.getAttribute("data-language"))), () => ( ""));
|
|
1543
1543
|
if (!/(?:^|\s)language-mermaid(?:\s|$)/.test(language) && language !== "mermaid") return false;
|
|
1544
|
-
const result =
|
|
1544
|
+
const result = _chunkGXEC4FS6cjs.chartFromMermaid.call(void 0, _nullishCoalesce((_nullishCoalesce(code, () => ( element))).textContent, () => ( "")));
|
|
1545
1545
|
return result.family ? { spec: result.spec } : false;
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
@@ -1565,7 +1565,7 @@ var Chart = _core.Node.create({
|
|
|
1565
1565
|
return {
|
|
1566
1566
|
markdown: {
|
|
1567
1567
|
serialize(state, node) {
|
|
1568
|
-
const text =
|
|
1568
|
+
const text = _chunkGXEC4FS6cjs.chartToMermaid.call(void 0, node.attrs.spec);
|
|
1569
1569
|
const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
|
|
1570
1570
|
state.write(`${fence}mermaid
|
|
1571
1571
|
`);
|
|
@@ -1705,14 +1705,14 @@ var Sparkline = _core.Node.create({
|
|
|
1705
1705
|
return [{ tag: 'span[data-type="sparkline"]', priority: 60 }];
|
|
1706
1706
|
},
|
|
1707
1707
|
renderHTML({ node, HTMLAttributes }) {
|
|
1708
|
-
const scene =
|
|
1708
|
+
const scene = _chunkGXEC4FS6cjs.layoutSparkline.call(void 0, node.attrs.values, {
|
|
1709
1709
|
kind: node.attrs.kind,
|
|
1710
1710
|
width: node.attrs.width,
|
|
1711
1711
|
height: node.attrs.height,
|
|
1712
1712
|
color: _nullishCoalesce(node.attrs.color, () => ( this.options.color)),
|
|
1713
1713
|
negativeColor: this.options.negativeColor
|
|
1714
1714
|
});
|
|
1715
|
-
const svg =
|
|
1715
|
+
const svg = _chunkGXEC4FS6cjs.chartSceneToDomSpec.call(void 0, scene, {
|
|
1716
1716
|
ariaLabel: sparklineLabel(node),
|
|
1717
1717
|
attrs: { style: "display: inline-block; vertical-align: middle" }
|
|
1718
1718
|
});
|
|
@@ -1503,6 +1503,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1503
1503
|
plot,
|
|
1504
1504
|
valueScale: toValueScale(frame.value, horizontal ? "x" : "y"),
|
|
1505
1505
|
...frame.value2 ? { valueScale2: toValueScale(frame.value2, horizontal ? "x" : "y") } : {},
|
|
1506
|
+
categoryScale: { axis: horizontal ? "y" : "x", start: catStart, length: frame.catLen, count: frame.n, reverse: !!spec.xAxis.reverse },
|
|
1506
1507
|
percent
|
|
1507
1508
|
};
|
|
1508
1509
|
}
|
|
@@ -2732,7 +2733,8 @@ function layoutChart(spec, options) {
|
|
|
2732
2733
|
warnings,
|
|
2733
2734
|
...result.valueScale ? { valueScale: result.valueScale } : {},
|
|
2734
2735
|
...result.valueScale2 ? { valueScale2: result.valueScale2 } : {},
|
|
2735
|
-
...result.xScale ? { xScale: result.xScale } : {}
|
|
2736
|
+
...result.xScale ? { xScale: result.xScale } : {},
|
|
2737
|
+
...result.categoryScale ? { categoryScale: result.categoryScale } : {}
|
|
2736
2738
|
};
|
|
2737
2739
|
};
|
|
2738
2740
|
const empty = (message) => {
|
|
@@ -2935,6 +2937,14 @@ function chartValueAtPoint(scene, point, secondary = false) {
|
|
|
2935
2937
|
const px = scale.axis === "y" ? point.y : point.x;
|
|
2936
2938
|
return chartScaleFromPixel(px, scale);
|
|
2937
2939
|
}
|
|
2940
|
+
function chartCategoryAtPoint(scene, point) {
|
|
2941
|
+
const scale = scene.categoryScale;
|
|
2942
|
+
const { plot } = scene;
|
|
2943
|
+
if (!scale || point.x < plot.x || point.x > plot.x + plot.width || point.y < plot.y || point.y > plot.y + plot.height) return void 0;
|
|
2944
|
+
const offset = (scale.axis === "x" ? point.x : point.y) - scale.start;
|
|
2945
|
+
const k = Math.min(scale.count - 1, Math.max(0, Math.floor(offset / scale.length * scale.count)));
|
|
2946
|
+
return scale.reverse ? scale.count - 1 - k : k;
|
|
2947
|
+
}
|
|
2938
2948
|
function chartXAtPoint(scene, point) {
|
|
2939
2949
|
const scale = scene.xScale;
|
|
2940
2950
|
if (!scale) return void 0;
|
|
@@ -2998,4 +3008,5 @@ function snapChartValue(scene, value, step, ticks = _nullishCoalesce(_optionalCh
|
|
|
2998
3008
|
|
|
2999
3009
|
|
|
3000
3010
|
|
|
3001
|
-
|
|
3011
|
+
|
|
3012
|
+
exports.parseChartDate = parseChartDate; exports.CHART_DATE_STEPS = CHART_DATE_STEPS; exports.formatChartDate = formatChartDate; exports.chartDateLabels = chartDateLabels; exports.compileChartFormatCode = compileChartFormatCode; exports.formatChartValueWithCode = formatChartValueWithCode; exports.chartSerialToDate = chartSerialToDate; exports.chartDateToSerial = chartDateToSerial; exports.niceStep = niceStep; exports.niceScale = niceScale; exports.stepDecimals = stepDecimals; exports.formatChartNumber = formatChartNumber; exports.linearMap = linearMap; exports.niceLogScale = niceLogScale; exports.chartScaleToPixel = chartScaleToPixel; exports.chartScaleFromPixel = chartScaleFromPixel; exports.estimateChartTextWidth = estimateChartTextWidth; exports.sameChartSelection = sameChartSelection; exports.contrastingTextColor = contrastingTextColor; exports.r2 = r2; exports.chartHistogram = chartHistogram; exports.chartQuantile = chartQuantile; exports.suggestChartReferences = suggestChartReferences; exports.chartBoxStats = chartBoxStats; exports.chartSquarify = chartSquarify; exports.decimateChartPoints = decimateChartPoints; exports.summarizeChartSeries = summarizeChartSeries; exports.fitChartTrendline = fitChartTrendline; exports.trendNumberText = trendNumberText; exports.chartMovingAverage = chartMovingAverage; exports.chartTrendlineName = chartTrendlineName; exports.chartSupportsTrendlines = chartSupportsTrendlines; exports.MAX_CHART_DATA_LABELS = MAX_CHART_DATA_LABELS; exports.MAX_CHART_LINE_POINTS = MAX_CHART_LINE_POINTS; exports.MAX_CHART_MARKERS = MAX_CHART_MARKERS; exports.registerChartMap = registerChartMap; exports.getChartMap = getChartMap; exports.listChartMaps = listChartMaps; exports.matchChartMapRegions = matchChartMapRegions; exports.chartMapBreaks = chartMapBreaks; exports.chartMapClass = chartMapClass; exports.chartMapRamp = chartMapRamp; exports.chartRaceValueAt = chartRaceValueAt; exports.chartRaceMoment = chartRaceMoment; exports.chartRaceRanking = chartRaceRanking; exports.layoutChart = layoutChart; exports.chartValueAtPoint = chartValueAtPoint; exports.chartCategoryAtPoint = chartCategoryAtPoint; exports.chartXAtPoint = chartXAtPoint; exports.snapChartValue = snapChartValue;
|