Skip to content

Sample size ​

Deprecated

<Graphic> and its kinds are deprecated and will be removed in a later release; the lint warns on each one. Draw the same thing with <Motion>, <Three> or a <Layer>: the examples show each, and Free code explains them.

A field of dots for a sample of n, with share of them highlighted, appearing over appearFor seconds. Past 1,000 each dot stands for several (perDot), and the note says so. The label may use {n} and {share}. Animated: it changes over its whole duration.

tsx
<Composition fps={30} width={640} height={360}>
  <Track id="main" layout="free">
    <Graphic
      id="g1"
      kind="sample-size"
      n={1200}
      share={0.38}
      label="{share} of {n} said yes"
      start={0}
      duration={3}
    />
  </Track>
</Composition>

Props ​

proptypedefault
ninteger1200
sharenumber (0..1)
perDotinteger
layout"grid" | "scatter""grid"
appearFornumber (0..60)1.5
labelstring"n = {n}"
colorstring"$muted"
highlightstring"$primary"
labelColorstring"$text"
fontstring"$body"

Plus the <Graphic> props every kind takes. More in Data.

MIT licensed.