Giter Club home page Giter Club logo

color-legend-element's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ˜„ Pronouns: he/him/his
  • ๐Ÿ”ญ Iโ€™m typically working on StoryMaps.com
  • ๐Ÿ’ฌ Ask me about: web prototyping, data vis, cartographic design, D3JS, LeafletJS, React, CSS
  • ๐Ÿ“ซ How to reach me: @[email protected] or my website
  • โšก Fun fact: I road my bicycle across the U.S. and Canada (via the "Northern Tier" route), it was a long bike ride ๐Ÿšด

color-legend-element's People

Contributors

clhenrick avatar dependabot[bot] 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

Watchers

 avatar  avatar

color-legend-element's Issues

Support for node.js 20+?

Hi there,

Just curious if there are any plans to upgrade this package for use in node.js 20+. I was using it successfully in an older version of node but came across issues with it once upgrading.

Thanks so much,
S

Bug: rollup build includes d3 modules in bundle

After switching over to the individual d3 modules in #8 the rollup.config.js was not updated to specify them as external packages, so they are being included with the JS bundles when npm run bundle is run.

Idea: Support legends that work for colour deficient people

While it is generally OK to use continuous gradients for area-based visializations (such as heat maps), especially when graduating by lightness only, it is certainly the case that vsualisations relying on colour only to distinguish discreet values do not work for colour deficient users.

Examples of these are pie charts, stacked bar charts and multi-line graphs.

In such cases, the visualisations need to either:

  1. Directly connect the legend label to the visualisation component (e.g. Place label above, next to or on/in the relevant component) when appearing just once
  2. Use a secondary distinction, such as line style, area pattern or texture depending on the type of visualisation.

Array.at bug in Safari

The Array.prototype.at() method is not supported in Safari. This is causing the discrete and threshold legends to not render in Safari.

update docs with windows os issues resolving peer deps

When used with a module bundler, a Windows OS user reported that the CLE could not find the required D3JS modules. Being more specific with the import resolved the issue:

import 'color-legend-element/build/color-legend-element.js';

Bug: CLE property `tickFormatter` does not influence how x-axis ticks are rendered

When setting the tickFormatter property via JavaScript, it is expected that for a non-categorical scaleType the x-axis's tick text will be formatted accordingly. However this currently does not appear to be the case.

Example code:

const cle = document.querySelector('color-legend');
cle.tickFormatter = (d) => `${d}หš`;

Expected output:

image

Actual output:

image

Idea: Expose event handlers on legend items

Emitting events for click, hover, focus, keypress, etc. that includes data such as the datum, color, bin, etc. The most difficult part of this I think would be making the SVG elements accessible, for example enabling focus states and keyboard navigation for SVG rects, and not have a broken experience for users of assistive technology.

From this Twitter convo

...returning a colour/bin/break id etc in an event would help developers tie the legend to the viz interactively. Only part of an ally solution of course, but helpful.

UMD build throws an error that prevents the library from working

During one of the library updates the UMD build started throwing an error.

Reproducible example: https://codepen.io/clhenrick/pen/abxRNGa

Error output from the console:

Uncaught (in promise) TypeError: i is undefined
    setContinousColorScale https://unpkg.com/[email protected]/build/color-legend-element.umd.js:45
    setColorScale https://unpkg.com/[email protected]/build/color-legend-element.umd.js:45
    willUpdate https://unpkg.com/[email protected]/build/color-legend-element.umd.js:190
    performUpdate https://unpkg.com/[email protected]/build/color-legend-element.umd.js:12
    scheduleUpdate https://unpkg.com/[email protected]/build/color-legend-element.umd.js:12
    _$ET https://unpkg.com/[email protected]/build/color-legend-element.umd.js:12
    requestUpdate https://unpkg.com/[email protected]/build/color-legend-element.umd.js:12
    set interpolator https://unpkg.com/[email protected]/build/color-legend-element.umd.js:190
    set https://unpkg.com/[email protected]/build/color-legend-element.umd.js:12
    <anonymous> https://cdpn.io/cpe/boomboom/pen.js?key=pen.js-3bc46d33-61e5-8000-5ba5-5c5987fea972:5
[color-legend-element.umd.js:45:422](https://unpkg.com/[email protected]/build/color-legend-element.umd.js)

Vertical Legend

Thank you for this library.

Is it possible to have a vertical legend, instead of the horizontal ones shown in the examples?

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.