Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component | Annotations: Introducing new component #359

Merged
merged 3 commits into from Apr 4, 2024
Merged

Conversation

reb-dev
Copy link
Collaborator

@reb-dev reb-dev commented Mar 29, 2024

Updated version of #299, #273

A new component that allows placing textual annotations on top of a visualization.

Here's an example of how annotations can be defined

const annotations: AnnotationItem[] = [
    {
      x: '50%',
      y: '98%',
      width: '50%',
      verticalAlign: 'bottom',
      content: [{
        text: 'Bitcoin Price Peaks from 2010 to 2023',
        fontSize: 28,
        fontWeight: 700,
        fontFamily: 'Helvetica',
        color: '#1C72E8',
      },
      {
        text: 'The chart illustrates the historical price peaks of Bitcoin from its inception in 2010 through 2023.',
        fontSize: 18,
        fontFamily: 'Helvetica',
        color: '#282C34',
        fontWeight: 400,
        lineHeight: 1.5,
        marginTop: 8,
      }],
    },
    {
      x: '2%',
      y: '25%',
      width: 100,
      content: 'First peak, June 2011',
      subject: {
        x: () => xScale(peak2011Datum[0]),
        y: () => yScale(peak2011Datum[1]),
        connectorLineStrokeDasharray: '2 2',
        radius: 6,
      },
    },
...
image

@reb-dev reb-dev merged commit 4662f65 into main Apr 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants