Giter VIP home page Giter VIP logo

datorama-d3-chord-chart's Introduction

datorama-d3-chord-chart

Custom widget for Datorama. Visualises weights of relationships between dimensions.

This custom widget creates a chord chart, with lines linking entities of two dimensions, sized by a metric. Hovering over the nodes will highlight all related links, and hovering over a link will highlight that link and show a tooltip with the specific number.

Preview image

Preferences

Add this code to the JS section of the Custom Widget Editor. The colorScheme attribute will accept the name of any gradient found on the D3 color schemes gallery, and will default to Sinebow for invalid choices.

var prefs = {
  'colorScheme': 'Sinebow', // Choose a scheme name from any of the gradients here https://observablehq.com/@d3/color-schemes
  'summable': true // true or false; affects summing and display of subtotals on the sides
};

Common Style Changes

To change the style of text, use the below selectors in the CSS section of the Custom Widget Editor. All the usual text styles can be applied, such as font-family, font-size, font-style, color, etc.. The #total element is SVG, so use fill instead of color.

body {
  
}

.tooltip-value {
  
}

#total {
  
}

The size of the total can't be changed, as that is set to fill the available space.

Set up and Dependencies

Add chordChart.initialize(); to the JS section, and add the below links to the dependencies area (second button at the top left of the Custom Widget Editor).

Script dependencies (must be loaded in this order):

  1. https://d3js.org/d3.v6.min.js
  2. https://dato-custom-widgets-js-css.s3.eu-west-2.amazonaws.com/chord-chart/Chord+Chart.js

Style dependency:

  1. https://dato-custom-widgets-js-css.s3.eu-west-2.amazonaws.com/chord-chart/Chord+Chart.css

datorama-d3-chord-chart's People

Contributors

jdharrisnz avatar

Stargazers

 avatar

Watchers

 avatar

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.