2022-09-19 15:11:10 +00:00
|
|
|
Class {
|
|
|
|
#name : #EcSunburstSegment,
|
|
|
|
#superclass : #Object,
|
|
|
|
#instVars : [
|
|
|
|
'name',
|
|
|
|
'value',
|
|
|
|
'children',
|
|
|
|
'color'
|
|
|
|
],
|
|
|
|
#category : #'EchartsPharo-EchartsPharo'
|
|
|
|
}
|
|
|
|
|
2022-09-21 22:15:28 +00:00
|
|
|
{ #category : #'instace creation' }
|
|
|
|
EcSunburstSegment class >> name: aName value: aNumber color: aColor children: anEcSunburstSegment [
|
|
|
|
|
|
|
|
^ self new
|
|
|
|
name: aName;
|
|
|
|
value: aNumber;
|
|
|
|
color: aColor;
|
|
|
|
children: anEcSunburstSegment;
|
|
|
|
yourself
|
|
|
|
]
|
|
|
|
|
2022-09-22 14:07:56 +00:00
|
|
|
{ #category : #'instace creation' }
|
|
|
|
EcSunburstSegment class >> rootName: aString [
|
|
|
|
|
|
|
|
^ self new
|
|
|
|
name: aString;
|
|
|
|
value: 0;
|
|
|
|
yourself
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> asEcObjectString [
|
|
|
|
|
2022-09-22 14:27:26 +00:00
|
|
|
self isRoot
|
|
|
|
ifFalse: [
|
|
|
|
^ '{ name: ', name, ',
|
|
|
|
value: ', value asString, ',
|
|
|
|
color: ', '''', (color ifNil: [ '' ] ifNotNil: [ color asHTMLColor ]), '''', ',
|
|
|
|
children: [',
|
|
|
|
']',
|
|
|
|
Character cr asString,
|
|
|
|
'}'
|
|
|
|
]
|
|
|
|
ifTrue: [
|
|
|
|
^ '{ name: ', name, ',
|
|
|
|
color: ', '''', (color ifNil: [ '' ] ifNotNil: [ color asHTMLColor ]), '''', ',
|
|
|
|
children: []',
|
|
|
|
Character cr asString,
|
|
|
|
'}'
|
|
|
|
]
|
2022-09-22 14:07:56 +00:00
|
|
|
]
|
|
|
|
|
2022-09-21 22:15:28 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> children [
|
|
|
|
|
|
|
|
^ children
|
|
|
|
]
|
|
|
|
|
2022-09-19 15:11:10 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> children: anEcSunburstSegment [
|
|
|
|
|
|
|
|
children := anEcSunburstSegment
|
|
|
|
]
|
|
|
|
|
2022-09-21 22:15:28 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> color [
|
|
|
|
|
|
|
|
^ color
|
|
|
|
]
|
|
|
|
|
2022-09-19 15:11:10 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> color: aColor [
|
|
|
|
|
|
|
|
color := aColor
|
|
|
|
]
|
|
|
|
|
2022-09-22 14:07:56 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> isRoot [
|
|
|
|
|
|
|
|
^ value = 0
|
|
|
|
]
|
|
|
|
|
2022-09-21 22:15:28 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> name [
|
|
|
|
|
|
|
|
^ name
|
|
|
|
]
|
|
|
|
|
2022-09-19 15:11:10 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> name: string [
|
|
|
|
|
|
|
|
name := string
|
|
|
|
]
|
|
|
|
|
2022-09-21 22:15:28 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> value [
|
|
|
|
|
|
|
|
^ value
|
|
|
|
]
|
|
|
|
|
2022-09-19 15:11:10 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
EcSunburstSegment >> value: number [
|
|
|
|
|
|
|
|
value := number
|
|
|
|
]
|