-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature request: default colours for groups #145
Comments
So... a (categorical) color scale? |
Hi @ntthung, would you be referring to categorical color scales here? We do have support for those found in d3: Categorical Color Scales, but please elaborate if they're not exactly what you had in mind. These can be specified the same way you currently specify other color scales like
|
I realized that I can do But let me explained my thought process. I was looking at this example in <vgg-graphic
:width="200"
:height="250"
:data="{
year: [
2000, 2005, 2010, 2015,
2000, 2005, 2010, 2015
],
population: [
100, 110, 130, 180,
200, 310, 430, 480
],
color: [
'#c66366', '#c66366', '#c66366',
'#c66366', '#008080', '#008080',
'#008080', '#008080'
]
}">
<vgg-section
:x1="25"
:x2="175"
:y1="25"
:y2="225"
scale-x="year"
scale-y="population"
:axes="{
left: {'tick-count': 4, 'w': 30},
bottom: {'tick-count': 4}
}"
>
<vgg-data :transform="{ groupBy: 'color' }">
<vgg-map v-slot="{ row }">
<vgg-multi-line
:x="row.grouped.year"
:y="row.grouped.population"
:stroke="row.color"
/>
</vgg-map>
</vgg-data>
</vgg-section>
</vgg-graphic> And then I replaced So perhaps only the documentation needs to be clarified. |
In the
vgg-multi-line
example, thegroupBy
operation was carried out on the colours. In a real life case, users are more likely to group by some sort of ID. The user will then need to write a method to map from IDs to colours. It would be nice to set default colours for groups.The text was updated successfully, but these errors were encountered: