GithubHelp home page GithubHelp logo

More exports. about d3-color HOT 9 CLOSED

nkint avatar nkint commented on April 28, 2024
More exports.

from d3-color.

Comments (9)

curran avatar curran commented on April 28, 2024

Which variables in particular do you propose to export?

from d3-color.

Fil avatar Fil commented on April 28, 2024

I've often wanted the list of css color names, which I usually copy by hand.

from d3-color.

curran avatar curran commented on April 28, 2024

So named could be exported, maybe as namedColors or something https://github.com/d3/d3-color/blob/master/src/color.js#L19

from d3-color.

Fil avatar Fil commented on April 28, 2024

from d3-color.

nkint avatar nkint commented on April 28, 2024

Hi,
sorry for the delay in the answer.
@curran I would say namedColor is perfect.

Another thing I'm always copy and paste are the regex:

var reI = "\\s*([+-]?\\d+)\\s*",

Thanks @Fil for the observable link, but I would access it via npm (export from this package).

from d3-color.

Fil avatar Fil commented on April 28, 2024

In the notebook one can use the menu "download json" on the left of the cell
Capture d’écran 2021-02-13 aΜ€ 13 14 05

and get

[["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],…

from d3-color.

nkint avatar nkint commented on April 28, 2024

Hi! Sorry for the lag in this issue.
@Fil thanks for that but I would love to rely only on d3-color without external json.

Other then CSS color names I always copy&paste the regex.

I will be happy to make a PR with some more export. Do you think it will be ever a change to get merged?

Thanks.

from d3-color.

Fil avatar Fil commented on April 28, 2024

d3.color can convert the names so all you need in fact is this string:

"aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen"

from d3-color.

mbostock avatar mbostock commented on April 28, 2024

The requested pieces (the list of color names and the regular expressions used to parse) feel like internal implementation details and I am not in favor of exposing them. Thank you for the suggestion.

from d3-color.

Related Issues (20)

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.