Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope exports from Grapher util #1806

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions .changeset/rich-lizards-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/perseus": major
"@khanacademy/perseus-editor": patch
---

Scope exports from grapher's util
15 changes: 6 additions & 9 deletions packages/perseus-editor/src/widgets/grapher-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
import {
components,
Changeable,
GrapherUtil,
GrapherWidget,
SizingUtils,
DEFAULT_GRAPHER_PROPS,
chooseType,
defaultPlotProps,
getEquationString,
allTypes,
typeToButton,
} from "@khanacademy/perseus";
import * as React from "react";
import _ from "underscore";
Expand All @@ -14,14 +19,6 @@ import GraphSettings from "../components/graph-settings";
const {InfoTip, MultiButtonGroup} = components;
const {containerSizeClass, getInteractiveBoxFromSizeClass} = SizingUtils;
const Grapher = GrapherWidget.widget;
const {
DEFAULT_GRAPHER_PROPS,
allTypes,
chooseType,
defaultPlotProps,
getEquationString,
typeToButton,
} = GrapherUtil;

type Props = any;

Expand Down
9 changes: 8 additions & 1 deletion packages/perseus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ export {default as TableWidget} from "./widgets/table";
export {default as PlotterWidget} from "./widgets/plotter";
export {default as GrapherWidget} from "./widgets/grapher";

export * as GrapherUtil from "./widgets/grapher/util";
export {
allTypes,
DEFAULT_GRAPHER_PROPS,
chooseType,
defaultPlotProps,
getEquationString,
typeToButton,
} from "./widgets/grapher/util";

/**
* Misc
Expand Down
4 changes: 2 additions & 2 deletions packages/perseus/src/widgets/grapher/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {Coord} from "../../interactive2/types";
// @ts-expect-error - TS2339 - Property 'Plot' does not exist on type 'typeof Graphie'.
const Plot = Graphie.Plot;

export const DEFAULT_BACKGROUND_IMAGE = {
const DEFAULT_BACKGROUND_IMAGE = {
url: null,
} as const;

Expand Down Expand Up @@ -663,7 +663,7 @@ export const getEquationString = (props: any): string => {
return "";
};

export const pointsFromNormalized = (
const pointsFromNormalized = (
coordsList: ReadonlyArray<Coord>,
range: [Coord, Coord],
step: [number, number],
Expand Down
Loading