context.d.ts 833 B

1234567891011121314151617181920212223242526
  1. import type {GeoPath, GeoStreamWrapper} from "d3";
  2. import type {MarkOptions} from "./mark.js";
  3. /** Additional rendering context provided to marks and initializers. */
  4. export interface Context {
  5. /**
  6. * The current document. Defaults to window.document, but may be overridden
  7. * via plot options as when rendering plots in a headless environment.
  8. */
  9. document: Document;
  10. /** The current owner SVG element. */
  11. ownerSVGElement: SVGSVGElement;
  12. /** The Plot’s (typically generated) class name, for custom styles. */
  13. className: string;
  14. /** The current projection, if any. */
  15. projection?: GeoStreamWrapper;
  16. /** A function to draw GeoJSON with the current projection, if any, otherwise with the x and y scales. */
  17. path: () => GeoPath;
  18. /** The default clip for all marks. */
  19. clip?: MarkOptions["clip"];
  20. }