Skip to content

Export canonical viz-setting key types/constants for downstreams #1234

Description

@lmeyerov

Request: Export canonical Graphistry viz-setting key definitions for downstream type safety

Downstream projects (example: Louie/GraphistryGPT) need to pass and validate Graphistry visualization settings in a typed way, including:

  • URL params (embed / graph.html query options)
  • React-facing settings used by @graphistry/client-api-react

Today, downstreams often end up hardcoding local key unions / allowlists (e.g., Python Literal[...] + runtime JSON checks), which creates drift risk and maintenance overhead.

Proposed additions in pygraphistry

Please expose a canonical, machine-readable key surface, ideally one or more of:

  1. Exported Python constants

    • URL_PARAM_NAMES: tuple[str, ...]
    • REACT_SETTING_NAMES: tuple[str, ...] (if pygraphistry has/owns that view)
  2. Typed schemas/models

    • Optional TypedDict / pydantic model for settings payloads
    • Or a JSON Schema artifact that downstreams can consume for codegen
  3. Versioned contract file

    • Stable JSON file in package data with explicit key sets and basic value-shape metadata

Why this helps

  • Eliminates duplicated key lists across downstream repos
  • Improves static typing/autocomplete and safer LLM tool-contract synthesis
  • Enables single-source-of-truth tests across Python/TS stacks

Related upstream discussion in graphistry-js:

If useful, we can contribute a PR once maintainers confirm preferred API shape.

Activity

  1. lmeyerov commented on May 20, 2026

    @lmeyerov
    ContributorAuthor

    Closeout receipt for #1234: current master already satisfies the requested canonical viz-setting key contract, so no new PR was needed.

    Evidence on origin/master at 213d022:

    Validation:

    • python3 -m pytest -q graphistry/tests/test_validate_settings.py -> 17 passed.
    • git diff --check -> clean.
    • Review/no-PR convergence: two no-finding passes; no remaining implementation gap.
    • Compiler-plan surface touched: no.
    • DGX/cuDF: out of scope; no runtime/DataFrame/cuDF paths touched.

    Closing #1234 as implemented by the existing settings-contract surface.

  2. lmeyerov commented on May 20, 2026

    @lmeyerov
    ContributorAuthor

    #1234 follow-up implementation receipt:

    Merged PR #1587 at f7444a9.

    What changed:

    • Added graphistry.viz_settings as the public facade for canonical visualization settings contracts.
    • Exported URL param constants/types: URL_PARAM_NAMES, URL_PARAM_NAME_SET, URLParamName, URLParamsDict, KnownURLParamsDict.
    • Exported React settings constants/types: REACT_SETTING_NAMES, REACT_SETTING_NAME_SET, ReactSettingName, ReactSettingsDict, KnownReactSettingsDict.
    • Exported combined key surface: VIZ_SETTING_NAMES, VIZ_SETTING_NAME_SET, VizSettingName.
    • Re-exported apply-encodings React keys and frontend contract metadata from the same module.
    • Added drift tests anchoring the public facade to the canonical owner modules, Literal aliases, TypedDict annotations, and settings validators.

    Validation:

    • Local focused: python3 -m pytest -q graphistry/tests/test_viz_settings.py graphistry/tests/test_validate_settings.py -> 22 passed.
    • Local lint/types: ./bin/ruff.sh ... and ./bin/typecheck.sh ... -> passed.
    • git diff --check -> passed.
    • Review skill converged: wave 1 found/fixed validator anchoring coverage; waves 2 and 3 no findings.
    • Full PR CI green, including changed-line coverage, docs/RTD, core Python matrix, GFQL, pandas compatibility, graphviz, polars, REST, Neo4j, DGL CPU.
    • DGX/cuDF skipped: no DataFrame, cuDF, runtime execution, or GPU path touched.

    Compiler-plan surface touched: no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions