hexgrid.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import type {MarkOptions, RenderableMark} from "../mark.js";
  2. /** Options for the hexgrid mark. */
  3. export interface HexgridOptions extends MarkOptions {
  4. /**
  5. * The distance between centers of neighboring hexagons, in pixels; defaults
  6. * to 20. Should match the **binWidth** of the hexbin transform.
  7. */
  8. binWidth?: number;
  9. }
  10. /**
  11. * The hexgrid decoration mark complements the hexbin transform, showing the
  12. * outlines of all hexagons spanning the frame with a default **stroke** of
  13. * *currentColor* and a default **strokeOpacity** of 0.1, similar to the the
  14. * default axis grids. For example:
  15. *
  16. * ```js
  17. * Plot.plot({
  18. * marks: [
  19. * Plot.hexagon(Plot.hexbin({fill: "count"}, {binWidth: 12, x: "weight", y: "economy"})),
  20. * Plot.hexgrid({binWidth: 12})
  21. * ]
  22. * })
  23. * ```
  24. *
  25. * Note that the **binWidth** option of the hexgrid mark should match that of
  26. * the hexbin transform. The grid is clipped by the frame. This is a stroke-only
  27. * mark, and **fill** is not supported; to fill the frame, use the frame mark.
  28. */
  29. export function hexgrid(options?: HexgridOptions): Hexgrid;
  30. /** The hexgrid mark. */
  31. export class Hexgrid extends RenderableMark {}