Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

509 B
Raw Blame
/* Copyright 2026 Marimo. All rights reserved. */

import { createContext, use } from "react";
import { Functions } from "@/utils/functions";
import type { Field } from "./components/form-fields";
import { ChartType } from "./types";

export const ChartFormContext = createContext<{
  fields: Field[];
  saveForm: () => void;
  chartType: ChartType;
}>({
  fields: [],
  saveForm: Functions.NOOP,
  chartType: ChartType.LINE,
});

export const useChartFormContext = () => {
  return use(ChartFormContext);
};