Playground

This component's contract doesn't list typed props, so the playground shows its documented example.

Documented example VizMarkPreview : mount the authored fragment or shared-renderer SVG, SVG bytes hash 248677b82ea7b26d2f811baeb5f6cb67237a766b5b3a696cf8b0130912fa24a7.

The render follows the page's theme switch: light, dark or high contrast. Both frameworks render the same example.

The real VizMarkPreview, live
React
Vue

Code

The documented example. HTML is the markup the React component renders for it, which @oods/component-styles styles.

import { VizMarkPreview } from '@oods/components-react';
import '@oods/component-styles/css';

export function Example() {
  return (
    <VizMarkPreview
      svg={"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" class=\"marks\" width=\"370\" height=\"210\" viewBox=\"0 0 370 210\"><rect width=\"370\" height=\"210\" fill=\"#FDF3DE\"/><g fill=\"none\" stroke-miterlimit=\"10\" transform=\"translate(43,38)\"><g class=\"mark-group role-frame root\" role=\"graphics-object\" aria-roledescription=\"group mark container\"><g transform=\"translate(0,0)\"><path class=\"background\" aria-hidden=\"true\" d=\"M0,0h322v121h-322Z\"/><g><g class=\"mark-group role-axis\" aria-hidden=\"true\"><g transform=\"translate(0.5,0.5)\"><path class=\"background\" aria-hidden=\"true\" d=\"M0,0h0v0h0Z\" pointer-events=\"none\"/><g><g class=\"mark-rule role-axis-grid\" pointer-events=\"none\"><line transform=\"translate(0,121)\" x2=\"322\" y2=\"0\" stroke=\"#DAD0BA\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(0,91)\" x2=\"322\" y2=\"0\" stroke=\"#DAD0BA\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(0,61)\" x2=\"322\" y2=\"0\" stroke=\"#DAD0BA\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(0,30)\" x2=\"322\" y2=\"0\" stroke=\"#DAD0BA\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(0,0)\" x2=\"322\" y2=\"0\" stroke=\"#DAD0BA\" stroke-width=\"1\" opacity=\"1\"/></g></g><path class=\"foreground\" aria-hidden=\"true\" d=\"\" pointer-events=\"none\" display=\"none\"/></g></g><g class=\"mark-group role-axis\" role=\"graphics-symbol\" aria-roledescription=\"axis\" aria-label=\"X-axis titled 'Period' for a discrete scale with 2 values: Feb, Jan\"><g transform=\"translate(0.5,121.5)\"><path class=\"background\" aria-hidden=\"true\" d=\"M0,0h0v0h0Z\" pointer-events=\"none\"/><g><g class=\"mark-rule role-axis-tick\" pointer-events=\"none\"><line transform=\"translate(80,0)\" x2=\"0\" y2=\"5\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(241,0)\" x2=\"0\" y2=\"5\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/></g><g class=\"mark-text role-axis-label\" pointer-events=\"none\"><text text-anchor=\"end\" transform=\"translate(80.00000000000001,7) rotate(270) translate(0,3)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"10px\" fill=\"#4B4D5A\" opacity=\"1\">Feb</text><text text-anchor=\"end\" transform=\"translate(241,7) rotate(270) translate(0,3)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"10px\" fill=\"#4B4D5A\" opacity=\"1\">Jan</text></g><g class=\"mark-rule role-axis-domain\" pointer-events=\"none\"><line transform=\"translate(0,0)\" x2=\"322\" y2=\"0\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/></g><g class=\"mark-text role-axis-title\" pointer-events=\"none\"><text text-anchor=\"middle\" transform=\"translate(161,44)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"11px\" font-weight=\"bold\" fill=\"#18233C\" opacity=\"1\">Period</text></g></g><path class=\"foreground\" aria-hidden=\"true\" d=\"\" pointer-events=\"none\" display=\"none\"/></g></g><g class=\"mark-group role-axis\" role=\"graphics-symbol\" aria-roledescription=\"axis\" aria-label=\"Y-axis titled 'Value' for a linear scale with values from 0 to 40\"><g transform=\"translate(0.5,0.5)\"><path class=\"background\" aria-hidden=\"true\" d=\"M0,0h0v0h0Z\" pointer-events=\"none\"/><g><g class=\"mark-rule role-axis-tick\" pointer-events=\"none\"><line transform=\"translate(0,121)\" x2=\"-5\" y2=\"0\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(0,91)\" x2=\"-5\" y2=\"0\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(0,61)\" x2=\"-5\" y2=\"0\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(0,30)\" x2=\"-5\" y2=\"0\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/><line transform=\"translate(0,0)\" x2=\"-5\" y2=\"0\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/></g><g class=\"mark-text role-axis-label\" pointer-events=\"none\"><text text-anchor=\"end\" transform=\"translate(-7,124)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"10px\" fill=\"#4B4D5A\" opacity=\"1\">0</text><text text-anchor=\"end\" transform=\"translate(-7,93.75)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"10px\" fill=\"#4B4D5A\" opacity=\"1\">10</text><text text-anchor=\"end\" transform=\"translate(-7,63.5)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"10px\" fill=\"#4B4D5A\" opacity=\"1\">20</text><text text-anchor=\"end\" transform=\"translate(-7,33.25)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"10px\" fill=\"#4B4D5A\" opacity=\"1\">30</text><text text-anchor=\"end\" transform=\"translate(-7,3)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"10px\" fill=\"#4B4D5A\" opacity=\"1\">40</text></g><g class=\"mark-rule role-axis-domain\" pointer-events=\"none\"><line transform=\"translate(0,121)\" x2=\"0\" y2=\"-121\" stroke=\"#D6DAE4\" stroke-width=\"1\" opacity=\"1\"/></g><g class=\"mark-text role-axis-title\" pointer-events=\"none\"><text text-anchor=\"middle\" transform=\"translate(-27,60.5) rotate(-90) translate(0,-2)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"11px\" font-weight=\"bold\" fill=\"#18233C\" opacity=\"1\">Value</text></g></g><path class=\"foreground\" aria-hidden=\"true\" d=\"\" pointer-events=\"none\" display=\"none\"/></g></g><g class=\"mark-rect role-mark marks\" role=\"graphics-object\" aria-roledescription=\"rect mark container\"><path aria-label=\"Period: Jan; Value: 12\" role=\"graphics-symbol\" aria-roledescription=\"bar\" d=\"M169.05,84.69999999999999h144.9v36.30000000000001h-144.9Z\" fill=\"#416CD9\"/><path aria-label=\"Period: Jan; Value: 18\" role=\"graphics-symbol\" aria-roledescription=\"bar\" d=\"M169.05,30.25h144.9v54.44999999999999h-144.9Z\" fill=\"#416CD9\"/><path aria-label=\"Period: Feb; Value: 22\" role=\"graphics-symbol\" aria-roledescription=\"bar\" d=\"M8.050000000000011,54.449999999999996h144.9v66.55000000000001h-144.9Z\" fill=\"#416CD9\"/><path aria-label=\"Period: Feb; Value: 15\" role=\"graphics-symbol\" aria-roledescription=\"bar\" d=\"M8.050000000000011,9.074999999999994h144.9v45.375h-144.9Z\" fill=\"#416CD9\"/></g><g class=\"mark-group role-title\"><g transform=\"translate(-38,-33)\"><path class=\"background\" aria-hidden=\"true\" d=\"M0,0h0v0h0Z\" pointer-events=\"none\"/><g><g class=\"mark-text role-title-text\" role=\"graphics-symbol\" aria-roledescription=\"title\" aria-label=\"Title text 'Mark chart sample'\" pointer-events=\"none\"><text text-anchor=\"start\" transform=\"translate(0,19)\" font-family=\"'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif\" font-size=\"24px\" font-weight=\"600\" fill=\"#18233C\" opacity=\"1\">Mark chart sample</text></g></g><path class=\"foreground\" aria-hidden=\"true\" d=\"\" pointer-events=\"none\" display=\"none\"/></g></g></g><path class=\"foreground\" aria-hidden=\"true\" d=\"\" display=\"none\"/></g></g></g></svg>"}
      title="Mark chart sample"
      description="Four authored sample observations."
      width={360}
      height={200}
    />
  );
}

Props, slots and events

Contract version 1.1.0. Types are from the React declarations in @oods/components-react.

Props
PropTypeRequiredDocumented example
svg string | undefined no <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" class="marks" width="370" height="210" viewBox="0 0 370 210"><rect width="370" height="210" fill="#FDF3DE"/><g fill="none" stroke-miterlimit="10" transform="translate(43,38)"><g class="mark-group role-frame root" role="graphics-object" aria-roledescription="group mark container"><g transform="translate(0,0)"><path class="background" aria-hidden="true" d="M0,0h322v121h-322Z"/><g><g class="mark-group role-axis" aria-hidden="true"><g transform="translate(0.5,0.5)"><path class="background" aria-hidden="true" d="M0,0h0v0h0Z" pointer-events="none"/><g><g class="mark-rule role-axis-grid" pointer-events="none"><line transform="translate(0,121)" x2="322" y2="0" stroke="#DAD0BA" stroke-width="1" opacity="1"/><line transform="translate(0,91)" x2="322" y2="0" stroke="#DAD0BA" stroke-width="1" opacity="1"/><line transform="translate(0,61)" x2="322" y2="0" stroke="#DAD0BA" stroke-width="1" opacity="1"/><line transform="translate(0,30)" x2="322" y2="0" stroke="#DAD0BA" stroke-width="1" opacity="1"/><line transform="translate(0,0)" x2="322" y2="0" stroke="#DAD0BA" stroke-width="1" opacity="1"/></g></g><path class="foreground" aria-hidden="true" d="" pointer-events="none" display="none"/></g></g><g class="mark-group role-axis" role="graphics-symbol" aria-roledescription="axis" aria-label="X-axis titled 'Period' for a discrete scale with 2 values: Feb, Jan"><g transform="translate(0.5,121.5)"><path class="background" aria-hidden="true" d="M0,0h0v0h0Z" pointer-events="none"/><g><g class="mark-rule role-axis-tick" pointer-events="none"><line transform="translate(80,0)" x2="0" y2="5" stroke="#D6DAE4" stroke-width="1" opacity="1"/><line transform="translate(241,0)" x2="0" y2="5" stroke="#D6DAE4" stroke-width="1" opacity="1"/></g><g class="mark-text role-axis-label" pointer-events="none"><text text-anchor="end" transform="translate(80.00000000000001,7) rotate(270) translate(0,3)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="10px" fill="#4B4D5A" opacity="1">Feb</text><text text-anchor="end" transform="translate(241,7) rotate(270) translate(0,3)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="10px" fill="#4B4D5A" opacity="1">Jan</text></g><g class="mark-rule role-axis-domain" pointer-events="none"><line transform="translate(0,0)" x2="322" y2="0" stroke="#D6DAE4" stroke-width="1" opacity="1"/></g><g class="mark-text role-axis-title" pointer-events="none"><text text-anchor="middle" transform="translate(161,44)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="11px" font-weight="bold" fill="#18233C" opacity="1">Period</text></g></g><path class="foreground" aria-hidden="true" d="" pointer-events="none" display="none"/></g></g><g class="mark-group role-axis" role="graphics-symbol" aria-roledescription="axis" aria-label="Y-axis titled 'Value' for a linear scale with values from 0 to 40"><g transform="translate(0.5,0.5)"><path class="background" aria-hidden="true" d="M0,0h0v0h0Z" pointer-events="none"/><g><g class="mark-rule role-axis-tick" pointer-events="none"><line transform="translate(0,121)" x2="-5" y2="0" stroke="#D6DAE4" stroke-width="1" opacity="1"/><line transform="translate(0,91)" x2="-5" y2="0" stroke="#D6DAE4" stroke-width="1" opacity="1"/><line transform="translate(0,61)" x2="-5" y2="0" stroke="#D6DAE4" stroke-width="1" opacity="1"/><line transform="translate(0,30)" x2="-5" y2="0" stroke="#D6DAE4" stroke-width="1" opacity="1"/><line transform="translate(0,0)" x2="-5" y2="0" stroke="#D6DAE4" stroke-width="1" opacity="1"/></g><g class="mark-text role-axis-label" pointer-events="none"><text text-anchor="end" transform="translate(-7,124)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="10px" fill="#4B4D5A" opacity="1">0</text><text text-anchor="end" transform="translate(-7,93.75)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="10px" fill="#4B4D5A" opacity="1">10</text><text text-anchor="end" transform="translate(-7,63.5)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="10px" fill="#4B4D5A" opacity="1">20</text><text text-anchor="end" transform="translate(-7,33.25)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="10px" fill="#4B4D5A" opacity="1">30</text><text text-anchor="end" transform="translate(-7,3)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="10px" fill="#4B4D5A" opacity="1">40</text></g><g class="mark-rule role-axis-domain" pointer-events="none"><line transform="translate(0,121)" x2="0" y2="-121" stroke="#D6DAE4" stroke-width="1" opacity="1"/></g><g class="mark-text role-axis-title" pointer-events="none"><text text-anchor="middle" transform="translate(-27,60.5) rotate(-90) translate(0,-2)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="11px" font-weight="bold" fill="#18233C" opacity="1">Value</text></g></g><path class="foreground" aria-hidden="true" d="" pointer-events="none" display="none"/></g></g><g class="mark-rect role-mark marks" role="graphics-object" aria-roledescription="rect mark container"><path aria-label="Period: Jan; Value: 12" role="graphics-symbol" aria-roledescription="bar" d="M169.05,84.69999999999999h144.9v36.30000000000001h-144.9Z" fill="#416CD9"/><path aria-label="Period: Jan; Value: 18" role="graphics-symbol" aria-roledescription="bar" d="M169.05,30.25h144.9v54.44999999999999h-144.9Z" fill="#416CD9"/><path aria-label="Period: Feb; Value: 22" role="graphics-symbol" aria-roledescription="bar" d="M8.050000000000011,54.449999999999996h144.9v66.55000000000001h-144.9Z" fill="#416CD9"/><path aria-label="Period: Feb; Value: 15" role="graphics-symbol" aria-roledescription="bar" d="M8.050000000000011,9.074999999999994h144.9v45.375h-144.9Z" fill="#416CD9"/></g><g class="mark-group role-title"><g transform="translate(-38,-33)"><path class="background" aria-hidden="true" d="M0,0h0v0h0Z" pointer-events="none"/><g><g class="mark-text role-title-text" role="graphics-symbol" aria-roledescription="title" aria-label="Title text 'Mark chart sample'" pointer-events="none"><text text-anchor="start" transform="translate(0,19)" font-family="'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="24px" font-weight="600" fill="#18233C" opacity="1">Mark chart sample</text></g></g><path class="foreground" aria-hidden="true" d="" pointer-events="none" display="none"/></g></g></g><path class="foreground" aria-hidden="true" d="" display="none"/></g></g></g></svg>
svgNarrow string | undefined no
svgWide string | undefined no
svgDark string | undefined no
svgDarkNarrow string | undefined no
svgDarkWide string | undefined no
svgHc string | undefined no
svgHcNarrow string | undefined no
svgHcWide string | undefined no
title string | undefined no Mark chart sample
description string | undefined no Four authored sample observations.
width number | undefined no 360
height number | undefined no 200

Slots

default

Events

none

States

unbound, rendered

Accessibility

Role
img
How it gets its name
aria-label on [data-oods-component="VizMarkPreview"]

Keyboard

The contract lists no keyboard behaviour.

Obligations in the contract

  • Static shared-renderer SVG is preserved inside a named image figure; absence is explicitly disclosed.

Recipe over VizAreaPreview's static SVG mechanism. VizMarkPreview uses the existing bar renderer; this is no new chart family. No pixels are invented when svg is absent.

Tokens

The token roles this component reads.

  • surface.panel
  • text.body

Readiness

The evidence recorded for this component, with its label.

proven-in-generated-apps: catalog_list gives this label when generated React and Vue apps in the runtime sweep that ships with this version both use the component. That sweep was measured on the published 0.4.1, not on this version.

Readiness evidence
EvidenceReactVue
stateimplemented-evidence-completeimplemented-evidence-complete
versioned contractpassedpassed
target implementationpassedpassed
package exportpassedpassed
public declarationpassedpassed
dependency closurepassedpassed
framework scenariopassedpassed
accessibilityverifiedverified
interactionnot-applicablenot-applicable
visual themesverifiedverified

VizMarkPreview displays an authored chart input or rendered static SVG and owns no focusable control or consumer action.

Use your own

You can replace this component with your own React or Vue component. Map it, and generated code imports yours at the exact version you name. A contract report, run in a real browser, lists what your component met, what it didn't, and what wasn't checked.

The component_map call, with the parts in angle brackets yours to fill:

{
  "action": "create",
  "apply": true,
  "externalSystem": "<your design system>",
  "externalComponent": "<YourVizMarkPreview>",
  "oodsTraits": [
    "MarkBar"
  ],
  "substitution": {
    "component": "VizMarkPreview",
    "react": {
      "package": "<your-package>/react",
      "version": "<exact version>",
      "export": "<YourVizMarkPreview>"
    },
    "vue": {
      "package": "<your-package>/vue",
      "version": "<exact version>",
      "export": "<YourVizMarkPreview>"
    }
  }
}

How this page was made

Generated at build from the published data, each source with the hash of what was read. The page's manifest.

  • Contract: @oods/component-contracts@0.10.1 componentContracts.VizMarkPreview sha256:785a8803f651…
  • Documented example: @oods/component-contracts@0.10.1 sharedScenarios VizMarkPreview sha256:25436f9ddede…
  • Catalog entry (catalog_list): generated/0.10.1/system/catalog.json VizMarkPreview sha256:50c49ea33153…
  • React readiness: @oods/components-react@0.10.1 readiness VizMarkPreview sha256:9d0ffca3ba9b…
  • Vue readiness: @oods/components-vue@0.10.1 readiness VizMarkPreview sha256:c499414e7cb7…
  • Prop types: generated/0.10.1/components/prop-types.json VizMarkPreview sha256:520236e3f821…