Skip to content

Commit

Permalink
💄 (chart-editor) further simplify setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Dec 4, 2023
1 parent d4484df commit c1c793b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions adminSiteClient/ChartEditorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,12 @@ export class ChartEditorPage
getGrapherInstance: (grapher: Grapher) => {
this.grapher = grapher
},
// admin-specific settings
dataApiUrlForAdmin:
this.context.admin.settings.DATA_API_FOR_ADMIN_UI, // passed this way because clientSettings are baked and need a recompile to be updated
shouldIncludeDetailsInStaticExport: false,
// reactive settings
bounds: this.bounds,
renderToStatic: !!this.editor?.showStaticPreview,
}
this.grapher.shouldIncludeDetailsInStaticExport = false
this.grapher.renderToStatic = !!this.editor?.showStaticPreview
this.grapherElement = <Grapher {...grapherConfig} />
this._isGrapherSet = true
}
Expand Down Expand Up @@ -320,8 +318,7 @@ export class ChartEditorPage
reaction(
() => this.editor && this.editor.showStaticPreview,
() => {
this.grapher.renderToStatic =
!!this.editor?.showStaticPreview
this.updateGrapher()
}
)
)
Expand Down

0 comments on commit c1c793b

Please sign in to comment.