You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem to solve
I have a table of contents (TOC) I want to create for a report.
Some parts of the TOC are supposed to be colored differently depending on the version of the report.
I can almost solve this, but the Array Filter only accepts fixed values as the filtering parameter while the report version is provided via json, since the template is supposed to fit all versions (and change accordingly).
Proposed solution
Use the dynamic colors functionality combined with Array Filter using a parameter provided in the json file.
Describe alternatives you've considered
I tried a solution based on the {bindColor()} marker combined with the array filter.
I set the color to the text to be #000001, then used the following marker. {bindColor(#000001, #hexa) = d.colorTable[version=d.version].color}
What I expected to happen is:
The value of d.version is used as a filter parameter to locate the corresponding color in the colorTable object.
Then this color is applied to the text in color #000001.
I have seen examples of a similar usage of this type of filter combined with bindColor, but the filter value is always static, like d.colorTable[version=3].color.
I think that this application of changing color based on a condition signalized via the json data could be very useful.
I have also tried using variations like: {bindColor(#000001, #hexa) = $fontColor($version)} {#fontColor($reportVersion) = d.colorTable[version = $reportVersion].color} {#version = d.version}
Additional context
I am using Carbone Studio
Data used:
Problem to solve
I have a table of contents (TOC) I want to create for a report.
Some parts of the TOC are supposed to be colored differently depending on the version of the report.
I can almost solve this, but the Array Filter only accepts fixed values as the filtering parameter while the report version is provided via json, since the template is supposed to fit all versions (and change accordingly).
Proposed solution
Use the dynamic colors functionality combined with Array Filter using a parameter provided in the json file.
Describe alternatives you've considered
I tried a solution based on the
{bindColor()}
marker combined with the array filter.I set the color to the text to be
#000001
, then used the following marker.{bindColor(#000001, #hexa) = d.colorTable[version=d.version].color}
What I expected to happen is:
The value of
d.version
is used as a filter parameter to locate the corresponding color in thecolorTable
object.Then this color is applied to the text in color
#000001
.I have seen examples of a similar usage of this type of filter combined with
bindColor
, but the filter value is always static, liked.colorTable[version=3].color
.I think that this application of changing color based on a condition signalized via the json data could be very useful.
I have also tried using variations like:
{bindColor(#000001, #hexa) = $fontColor($version)}
{#fontColor($reportVersion) = d.colorTable[version = $reportVersion].color}
{#version = d.version}
Additional context
I am using Carbone Studio
Data used:
Comment
I am happy to receive suggestions to solve my problem alternatively and also to provide any necessary further clarification :).
The text was updated successfully, but these errors were encountered: