Skip to content

Commit

Permalink
Minor change to expose default width/height
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Apr 5, 2024
1 parent e9a83ba commit c0e70c8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions echartsgoja.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import (
"github.com/dop251/goja_nodejs/require"
)

// DefaultWidth is the default chart width.
var DefaultWidth = 400

// DefaultHeight is the default chart height.
var DefaultHeight = 300

// ECharts handles rendering [Apache ECharts] as SVGs, wrapping a [goja]
// runtime vm.
//
Expand All @@ -38,8 +44,8 @@ type ECharts struct {
// New creates a new echarts instance.
func New(opts ...Option) *ECharts {
vm := &ECharts{
width: 400,
height: 300,
width: DefaultWidth,
height: DefaultHeight,
}
for _, o := range opts {
o(vm)
Expand Down

0 comments on commit c0e70c8

Please sign in to comment.