Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/stores/action_handlers/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ export default function (REG: ActionHandlerRegistry<AppStore, Actions.Action>) {
}

this.updatePlotSegments();
this.updateNestedCharts();
this.updateDataAxes();
this.updateScales();
this.solveConstraintsAndUpdateGraphics();
Expand Down
13 changes: 13 additions & 0 deletions src/app/stores/app_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ import {
} from "../../core/prototypes/plot_segments/utils";
import { AxisRenderer } from "../../core/prototypes/plot_segments/axis";
import { CompiledGroupBy } from "../../core/prototypes/group_by";
import glyph from "./action_handlers/glyph";

export interface ChartStoreStateSolverStatus {
solving: boolean;
Expand Down Expand Up @@ -1671,6 +1672,17 @@ export class AppStore extends BaseStore {
});
}

public updateNestedCharts() {
const nestedCharts = this.chart.glyphs.flatMap(g => g.marks.map(m => ({glyph: g, mark: m}))).filter(
({ mark }) => Prototypes.isType(mark.classID, "mark.nested-chart")
);

debugger;
nestedCharts.forEach(({ glyph, mark: nestedCharts }) => {
debugger;
});
}

public updateDataAxes() {
const mapElementWithTable = (table: string) => (el: any) => {
return {
Expand Down Expand Up @@ -2455,6 +2467,7 @@ export class AppStore extends BaseStore {
});
this.chartState = this.chartManager.chartState;
this.updatePlotSegments();
this.updateNestedCharts();
this.updateDataAxes();
this.updateScales();
this.solveConstraintsAndUpdateGraphics();
Expand Down
10 changes: 5 additions & 5 deletions src/container/chart_component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ export class ChartComponent extends React.Component<
return (element, event) => {
const rowIndices = element.rowIndices;
const modifiers = {
ctrlKey: event.ctrlKey,
shiftKey: event.shiftKey,
metaKey: event.metaKey,
clientX: (event as any).clientX,
clientY: (event as any).clientY,
ctrlKey: event?.ctrlKey,
shiftKey: event?.shiftKey,
metaKey: event?.metaKey,
clientX: (event as any)?.clientX,
clientY: (event as any)?.clientY,
event,
};
handler({ table: element.plotSegment?.table, rowIndices }, modifiers);
Expand Down
Loading