MAIDR JavaScript API
    Preparing search index...

    Class TactileSvgGeometryAbstract

    Reduces an SVG shape to dot-coordinate rings.

    This is the "scale the SVG down" step, done on the chart's geometry rather than on its pixels. Sampling the rendered image and thresholding it cannot survive the reduction — at this size a chart's axis spine covers a fraction of one pin, so any threshold that keeps the spines also fills in the labels and the margins. Working from the shapes keeps every mark at its true position and, more importantly, makes "outline only" expressible at all: a thresholded image has no notion of a mark's boundary, only of its ink.

    Every shape is transformed through its own getScreenCTM, so nested transforms, viewBox scaling and the chart's own layout are all accounted for without this code having to understand any of them.

    Index

    Methods

    • Reports whether an element should contribute geometry.

      Skips MAIDR's own injected shapes — hidden highlight clones, overlay markers — so the tactile view shows the chart rather than a doubled copy of every mark plus whatever the visual highlight is currently drawing.

      Skips axis furniture too. A tick mark is one or two pins long here, so a row of them reads as a row of marks; and the pins an axis spine takes are pins the data is not using. What the axes mean belongs on the braille line, where it can be read rather than guessed at.

      Parameters

      • element: Element

        The element to test

      Returns boolean

    • Drops the shapes that draw the panel the chart sits in.

      The plot background and the axis spines carry no data, and between them they cost more pins than the marks do: on a scatter plot the background rectangle, the four spines and the frame around them arrived as a band three pins deep around the whole display, and the window was sized to the panel rather than to the marks, so the points were squeezed into what was left. Removing them lets the marks own the grid.

      They cannot be found by name here. namesFurniture handles the libraries that label their output, but a chart that has been through MAIDR has had its groups renamed to maidr-<uuid> for selector use, taking matplotlib's patch_1 with it. What is left is the geometry, and the panel has a shape nothing else does: it either fills the whole extent or traces one of its edges.

      Never empties the list. A chart drawn as a single shape spanning its own extent — which is what any one shape does, measured against itself — would otherwise vanish entirely, and a blank display is the one outcome a reader cannot tell from a disconnected one.

      Parameters

      • shapes: readonly SVGGraphicsElement[]

        The candidates gathered from the chart's subtree

      Returns SVGGraphicsElement[]

      The candidates that are not panel furniture

    • Reduces one SVG shape to dot-coordinate rings.

      A group yields the rings of every shape beneath it, so a mark drawn as a <g> of parts renders as those parts rather than as its bounding box.

      Parameters

      • element: SVGGraphicsElement

        The shape to reduce

      • viewport: TactileViewport

        The active zoom and pan

      Returns DotRing[]

      Rings in dot coordinates; empty when the shape cannot be measured