Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D3js palettes not being implemented in schemes correctly #42

Closed
wbuchanan opened this issue Mar 28, 2016 · 1 comment
Closed

D3js palettes not being implemented in schemes correctly #42

wbuchanan opened this issue Mar 28, 2016 · 1 comment

Comments

@wbuchanan
Copy link
Owner

brewscheme, scheme(d3test) allsty(category10) allc(10) 

// Load the auto.dta data set
sysuse auto.dta, clear

// Create a graph with the scheme file above
tw  lowess mpg weight ||                                                    ///   
    scatter mpg weight if rep78 == 1 ||                                     ///   
    scatter mpg weight if rep78 == 2 ||                                     ///   
    scatter mpg weight if rep78 == 3 ||                                     ///   
    scatter mpg weight if rep78 == 4 ||                                     ///   
    scatter mpg weight if rep78 == 5,                                       ///   
    legend(order(2 "1"                                 ///   
    3 "2" 4 "3"                   ///   
    5 "4" 6 "5"))                 ///   
    scheme(d3test) 

Graph doesn't implement the palette colors correctly. Lines 300 - 310 of the resulting scheme file read:

color p       gs6
color p1 "127 127 127"
color p2 "140 86 75"
color p3 "148 103 189"
color p4 "188 189 34"
color p5 "214 39 40"
color p6 "227 119 194"
color p7 "23 190 207"
color p8 "255 127 14"
color p9 "31 119 180"
color p10 "44 160 44"

The colors are being interpreted and written to the scheme file is a bizarre order that doesn't match the ordering in the extras dataset:

colorid      pcolor      rgb                maxcolors        seqid                  meta     
1            10          31 119 180         10               category10101          D3js
2            10          255 127 14         10               category10102          D3js
3            10          44 160 44          10               category10103          D3js
4            10          214 39 40          10               category10104          D3js
5            10          148 103 189        10               category10105          D3js
6            10          140 86 75          10               category10106          D3js
7            10          227 119 194        10               category10107          D3js
8            10          127 127 127        10               category10108          D3js
9            10          188 189 34         10               category10109          D3js
10           10          23 190 207         10               category101010         D3js
wbuchanan added a commit that referenced this issue Apr 4, 2016
… caused by variable abbreviation issues in brewthemedata.do
@wbuchanan
Copy link
Owner Author

Pushed correction into dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant