Git Product home page Git Product logo

react-graph-gallery's Introduction

react-graph-gallery's People

Contributors

charleebrown avatar christopheranderson avatar curran avatar holtzy avatar ledenis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-graph-gallery's Issues

Add a "categorical rectangular circle packing" type

A "categorical rectangular circle packing" visualizes older and more up to date events of different categories affecting a certain amount of entities:

rectangular bars side by side each with a title (position: top or bottom): representing categories.
brightness/shade: older -> darker colored circle, new-> brighter colored circle (timestamp: based on creation date or last updated date)
circle size: corresponding to affected entities by the event
color (optional): a) just one color or b) one color per category or c) one color and a special color (e.g. red) to mark important/urgend events

Questioning Salary Data

Hi there! First of all thank you for blessing us with these beautiful charts and visualizations. I do have a question about the source data though - why is the range for Data Analyst so much higher than Data Scientist? From my experience, I actually think it should be the other way around.

Even from the linked article you provided here, it seems that Data Scientist is considerably higher than Data Analyst.

get the radius only from ResponsiveCirclePackingCanvas

hello I want to know if I can get the radius only from the ResponsiveCirclePackingCanvas function and then I want use them to generate circleGeometry using react three fiber so can I get this because I searched a lot but don't find the code location
thank you so much

`useDimensions` hook only responds on page resize.

If something causes an SVG to resize in the page without a browser resize occurring -
say, as in my app, you're using Flexbox and waiting for your data to load and fill in the page -
then the useDimensions hook you recommend becomes stuck using the original element dimensions.

Here is an upgraded copy I made which seems to run properly for any kind of element resizing.
I relied upon https://github.com/que-etc/resize-observer-polyfill for cross-browser resize detection.

import React from "react"
import ResizeObserver from 'resize-observer-polyfill';

export const useDimensions = (targetRef) => {
  const getDimensions = () => {
    const box = targetRef.current
      ? targetRef.current.getBoundingClientRect()
      : {}
    return {
      width: box.width || 0,
      height: box.height || 0
    };
  };

  const [dimensions, setDimensions] = React.useState(getDimensions);
  const handleResize = () => setDimensions(getDimensions());
  const ro = new ResizeObserver((entries, observer) => handleResize());

  React.useEffect(() => {
    if(targetRef.current) return ro.observe(targetRef.current);
  }, [targetRef])

  return dimensions;
}

This hook is mainly copied from https://www.react-graph-gallery.com/histogram#responsiveness .
I'm releasing this upgraded sample as public domain.

Google image preview

Some pages don't have any image in it. Resulting in poor google preview and no google image result

ChartOrSandbox doesn't match?

In the section "Line chart application" of timeseries, it looks like the ChartOrSandbox isn't rendering the same thing between the chart and when actually opening up the sandbox:

Without sandbox open (time series):
Screenshot 2024-03-29 at 2 37 22 PM

With sandbox open (group demo):
Screenshot 2024-03-29 at 2 37 41 PM

Apologies in advanced if this was expected!

License

I'm curious what open source license is this released under, if any?

I checked for a LICENSE file and in package.json but did not find any license.

It would be awesome to clarify the license. MIT or ISC would be a great fit I think.

Thank you for this amazing work!

Incorrect snippet used in `code for the Y axis react component` on scatter plot page

The code snippet you are here, is not the expected one since its code is not related to the code for the Y axis.

I believe this is the correct code snippet:

import { useMemo } from "react";
import { ScaleLinear } from "d3";

type AxisLeftProps = {
  yScale: ScaleLinear<number, number>;
  pixelsPerTick: number;
  width: number;
};

const TICK_LENGTH = 10;

export const AxisLeft = ({ yScale, pixelsPerTick, width }: AxisLeftProps) => {
  const range = yScale.range();

  const ticks = useMemo(() => {
    const height = range[0] - range[1];
    const numberOfTicksTarget = Math.floor(height / pixelsPerTick);

    return yScale.ticks(numberOfTicksTarget).map((value) => ({
      value,
      yOffset: yScale(value),
    }));
  }, [yScale]);

  return (
    <>
      {/* Ticks and labels */}
      {ticks.map(({ value, yOffset }) => (
        <g
          key={value}
          transform={`translate(0, ${yOffset})`}
          shapeRendering={"crispEdges"}
        >
          <line
            x1={-TICK_LENGTH}
            x2={width + TICK_LENGTH}
            stroke="#D2D7D3"
            strokeWidth={0.5}
          />
          <text
            key={value}
            style={{
              fontSize: "10px",
              textAnchor: "middle",
              transform: "translateX(-20px)",
              fill: "#D2D7D3",
            }}
          >
            {value}
          </text>
        </g>
      ))}
    </>
  );
};

This is just my small contribution so far to this amazing gallery ๐Ÿ˜‰

I've read a bunch of your old content and learned a lot from it. Thanks for your time and effort on this project ๐Ÿ‘

Hope to contribute more to it soon!

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.