Skip to content

Commit

Permalink
clarify mapping and just apply colorscale to the right color names
Browse files Browse the repository at this point in the history
  • Loading branch information
MetalBlueberry committed Aug 21, 2024
1 parent 2e8e6b5 commit b567802
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions examples/bar_custom/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func main() {
X: xValue,
Y: yValue,
Text: grob.ArrayOKArray(toString(yValue)...),
Textposition: grob.BarTextpositionAuto,
Hoverinfo: grob.BarHoverinfoNone,
Textposition: grob.ArrayOKValue(grob.BarTextpositionAuto),
Hoverinfo: grob.ArrayOKValue(grob.BarHoverinfoNone),
Marker: &grob.BarMarker{
Color: grob.ArrayOKValue(grob.UseColor(grob.Color(
markerColor.Hex(), // Use colorfull
Expand Down
2 changes: 2 additions & 0 deletions examples/wasm/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down
2 changes: 1 addition & 1 deletion generated/v2.19.0/graph_objects/contour_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/v2.19.0/graph_objects/contourcarpet_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/v2.19.0/graph_objects/layout_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/v2.29.1/graph_objects/contour_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/v2.29.1/graph_objects/contourcarpet_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/v2.29.1/graph_objects/layout_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/v2.31.1/graph_objects/contour_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/v2.31.1/graph_objects/contourcarpet_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/v2.31.1/graph_objects/layout_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion generator/typefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ func (file *typeFile) parseAttributes(namePrefix string, typePrefix string, attr

default:
ty := valTypeMap[attr.ValType]
if attr.ValType == ValTypeColor && attrs["colorscale"] != nil {

// Special case, the attribute color may also be a ColorScale
if attr.ValType == ValTypeColor && attr.Name == "color" && attrs["colorscale"] != nil {
ty = "ColorWithColorScale"
}
if attr.ArrayOK {
Expand Down

0 comments on commit b567802

Please sign in to comment.