Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
fix demo

go imports format

go imports format

go imports format
  • Loading branch information
innerpeacez committed Jan 14, 2022
1 parent 94567c8 commit c495336
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
4 changes: 3 additions & 1 deletion providers/component-protocol/components/bubblegraph/model.go
Expand Up @@ -14,7 +14,9 @@

package bubblegraph

import structure "github.com/erda-project/erda-infra/providers/component-protocol/utils/data-structure"
import (
structure "github.com/erda-project/erda-infra/providers/component-protocol/utils/data-structure"
)

// Below is standard struct for bubble graph related.
type (
Expand Down
2 changes: 1 addition & 1 deletion providers/component-protocol/components/linegraph/model.go
Expand Up @@ -17,7 +17,7 @@ package linegraph
import (
"sync"

"github.com/erda-project/erda-infra/providers/component-protocol/utils/data-structure"
structure "github.com/erda-project/erda-infra/providers/component-protocol/utils/data-structure"
)

// Below is standard struct for line graph related.
Expand Down
Expand Up @@ -15,7 +15,6 @@
package linegraph

import (
"github.com/erda-project/erda-infra/providers/component-protocol/utils/data-structure"
"reflect"

"github.com/erda-project/erda-infra/base/servicehub"
Expand All @@ -24,6 +23,7 @@ import (
"github.com/erda-project/erda-infra/providers/component-protocol/cpregister/base"
"github.com/erda-project/erda-infra/providers/component-protocol/cptype"
"github.com/erda-project/erda-infra/providers/component-protocol/protocol"
"github.com/erda-project/erda-infra/providers/component-protocol/utils/data-structure"
)

type provider struct {
Expand All @@ -39,11 +39,11 @@ func (p *provider) RegisterInitializeOp() (opFunc cptype.OperationFunc) {
d.SetXAxis("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
d.SetYAxis("Dimension", 1, 2, 3, 4, 5, 6, 7)
d.SetXOptions(&linegraph.Options{
DataStructure: &structure.DataStructure{Type: structure.String},
Structure: &structure.DataStructure{Type: structure.String},
})
d.SetYOptions([]*linegraph.Options{
{Dimension: "Dimension", DataStructure: &structure.DataStructure{Type: structure.Number}},
{Dimension: "Dimension2", DataStructure: &structure.DataStructure{Type: structure.Number}},
{Dimension: "Dimension", Structure: &structure.DataStructure{Type: structure.Number}},
{Dimension: "Dimension2", Structure: &structure.DataStructure{Type: structure.Number}},
}...)
d.SetYAxis("Dimension2", 7, 6, 5, 4, 3, 2, 1)

Expand Down
Expand Up @@ -14,6 +14,7 @@

package structure

//Type defined
const (
String Type = "string"
Number Type = "number"
Expand All @@ -27,6 +28,7 @@ const (
Throughput Type = "throughput"
)

//Precision defined
const (
K Precision = "K"
M Precision = "M"
Expand Down Expand Up @@ -56,8 +58,11 @@ const (
)

type (
Type string
Precision string
//Type .
Type string
//Precision .
Precision string
//DataStructure .
DataStructure struct {
Type Type `json:"type"`
Precision Precision `json:"precision"`
Expand Down

0 comments on commit c495336

Please sign in to comment.