-
Hi! How can I change labels and color of the categories in a SetColumn? For categorical columns i use the Her's what I'm doing: const data = [
{tissuename: 'TCGA1', cohort: ['1', '2', '3']},
{tissuename: 'TCGA2', cohort: ['1']},
{tissuename: 'TCGA3', cohort: ['1', '3']}
];
const setColumnDesc = {type: 'set', label: 'Set', column: 'cohort', categories: ['1', '2', '3']};
const builder = LineUpJS.builder(data)
.column(LineUpJS.buildStringColumn('tissuename'))
.column(setColumnDesc)
.build(document.querySelector('#lineup')); Codepen: https://codepen.io/keckelt/pen/JjWmjMJ I would like to specify the color (e.g., 1=🟡,2=🟠,3=🔴) and label (e.g., Lung Cancer, Colon Cancer, Breast Cancer) of each category. |
Beta Was this translation helpful? Give feedback.
Answered by
sgratzl
Jun 16, 2021
Replies: 1 comment
-
The Then you can do just: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
keckelt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
CategoricalColumnBuilder
has a.asSet()
method converting a categorical definition in a set definition.Then you can do just:
https://codepen.io/sgratzl/pen/QWpYNby?editors=0010