aboutsummaryrefslogtreecommitdiffstats
path: root/ui-web/src/graphics.tsx
blob: 2d452df44aada56b062c0da28aa2ea7637093d51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export function Equalizer() {
  return (
    <svg className="eq" width="16" height="12" viewBox="0 0 16 12" aria-hidden="true">
      <rect className="b0" x="0" width="4" height="12" rx="1" />
      <rect className="b1" x="6" width="4" height="12" rx="1" />
      <rect className="b2" x="12" width="4" height="12" rx="1" />
    </svg>
  );
}

export function Sparkline({ negative }: { negative: boolean }) {
  return (
    <svg className={negative ? 'spark neg' : 'spark'} width="64" height="28" viewBox="0 0 64 28" aria-hidden="true">
      <polyline className="draw" pathLength="100" points="2,20 14,16 26,22 38,11 50,14 62,5" />
      <circle className="rider" r="2.8" />
    </svg>
  );
}

export function MarketChart() {
  return (
    <svg className="mchart" width="300" height="162" viewBox="0 0 240 130" aria-hidden="true">
      <line className="rule" x1="18" y1="20" x2="228" y2="20" />
      <line className="rule" x1="18" y1="65" x2="228" y2="65" strokeDasharray="3 4" />
      <line className="rule" x1="18" y1="110" x2="228" y2="110" />
      <line className="rule" x1="18" y1="14" x2="18" y2="116" />
      <text x="0" y="24">
        1.0
      </text>
      <text className="lo" x="0" y="114">
        0.0
      </text>
      <path className="draw y" pathLength="100" d="M22 66 C96 64 150 22 224 22" />
      <path className="draw n" pathLength="100" d="M22 66 C96 68 150 110 224 110" />
      <circle className="rider y" r="4" />
      <circle className="rider n" r="4" />
    </svg>
  );
}

export function Pinwheel() {
  return (
    <svg className="pinwheel" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">
      <g>
        <path d="M 10 10 L 10 2 A 8 8 0 0 1 15.65 4.35 Q 12 8 10 10 Z M 10 10 L 18 10 A 8 8 0 0 1 15.65 15.65 Q 12 12 10 10 Z M 10 10 L 10 18 A 8 8 0 0 1 4.35 15.65 Q 8 12 10 10 Z M 10 10 L 2 10 A 8 8 0 0 1 4.35 4.35 Q 8 8 10 10 Z" />
        <circle cx="10" cy="10" r="2.2" />
      </g>
    </svg>
  );
}