Skip to content

feat(validation): expose strict reusable settings validators #1240

@lmeyerov

Description

@lmeyerov

Problem

PlotterBase.settings(url_params=...) currently merges arbitrary keys/values into _url_params with minimal validation.

For downstream tool surfaces, we need reusable strict validation of view-setting payloads (URL params and axis/encoding-like structured settings) with explicit error messages.

Current behavior

settings() effectively does:

  • res._url_params = dict(self._url_params, **url_params)

Collections have a dedicated validator path, but most settings do not.

Additional audit notes (2026-04-29)

  • In Louie/GraphAgent, bad settings are often silently dropped by allowlist/type filters and only logged at debug level.
  • Without a canonical strict validator from pygraphistry, downstream integrations duplicate partial checks and drift.
  • Axis-related payloads (encodeAxis, ring axis configs) especially need deep, reusable validation APIs.

Requested behavior

Provide a canonical validation API for settings payloads, for example:

  • strict mode that raises on invalid keys/types/ranges
  • optional autofix mode for best-effort normalization
  • machine-readable schema for valid key/value contracts

This could include helpers to validate:

  • URL params (scalar/bool/ranged numeric where appropriate)
  • React-style settings values and known complex payloads
  • axis-like row structures (for encode axis payloads)

Why this matters

  • Makes PyGraphistry validation reusable by downstream integrations.
  • Avoids each integration duplicating ad-hoc allowlists and type checks.
  • Produces clear, actionable errors for user-facing agent flows.

Related

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