Code Monkey home page Code Monkey logo

react-composable-charts's Issues

Fix text.element props

   <element.text
            x={xPos}
            y={yPos}
            fill={DEFAULT_BLUE}
            fontSize={14}
            contentScriptType={selectedItem?.label}
            // @ts-expect-error
            text={selectedItem?.label}
          />

fix text attribute in element.text

Update enter attribute


  const animationEnterProp = {
    y: (_: BarchartCountriesDataset[number], index: number, nodes: SVGTextElement[]) => {
      const selectedNode = nodes[index]
      const y = selectedNode.getAttribute('y')
      return y
    }
  }

  <BarData
                data={countriesRanking}
                dataKey={(d) => d.countryIso3}
                y={(d) => d.countryIso3}
                x={{ to: () => xDomain[0], base: () => xDomain[1] }}
                fill={'#F1F2F5'}
                enter={animationEnterProp}
                opacity={1}
              />

Dare la possibilità di passare una funzione all'attributo enter

LabelData: Text as Component

It should be useful to use Text based component inside "LabelsData".

If the property "text" of this component will return a JSX element it will be very easy to show text data driven informations near charts element

Screenshot 2024-05-14 at 09 59 55

Tooltip Documentation

Tooltip Component

Description:
Tooltip is a functional component used to display tooltip content at a specified position relative to its target.

Props:
x: X-coordinate position of the tooltip.
y: Y-coordinate position of the tooltip.
children (optional): The content to be displayed within the tooltip.
style (optional): Additional CSS styles for the tooltip.
horizontalAnchor (optional): Horizontal anchor position of the tooltip: 'start' | 'center' | 'end'. Default is 'center'.
verticalAnchor (optional): Vertical anchor position of the tooltip: 'start' | 'center' | 'end'. Default is 'center'.
horizontalSpacing (optional): Horizontal spacing between the tooltip and its target.
verticalSpacing (optional): Vertical spacing between the tooltip and its target.

Example:

<Tooltip
  x={100}
  y={100}
  horizontalAnchor="start"
  verticalAnchor="end"
  horizontalSpacing={10}
  verticalSpacing={5}
>
  {/* Tooltip content */}
</Tooltip>

Export Stack<T> Type

It would be useful we can import this type from src/lib/stack.ts

type Stack<T> = {
  datum: T
  to: number
  base: number
  group: string
  category: string | number
  value: number
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.