108 lines
1.7 KiB
Smalltalk
108 lines
1.7 KiB
Smalltalk
Class {
|
|
#name : #EcSunburstSegment,
|
|
#superclass : #Object,
|
|
#instVars : [
|
|
'name',
|
|
'value',
|
|
'children',
|
|
'color'
|
|
],
|
|
#category : #'EchartsPharo-EchartsPharo'
|
|
}
|
|
|
|
{ #category : #'instace creation' }
|
|
EcSunburstSegment class >> name: aName value: aNumber color: aColor children: anEcSunburstSegment [
|
|
|
|
^ self new
|
|
name: aName;
|
|
value: aNumber;
|
|
color: aColor;
|
|
children: anEcSunburstSegment;
|
|
yourself
|
|
]
|
|
|
|
{ #category : #'instace creation' }
|
|
EcSunburstSegment class >> rootName: aString [
|
|
|
|
^ self new
|
|
name: aString;
|
|
value: 0;
|
|
yourself
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> asEcObjectString [
|
|
|
|
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,
|
|
'}'
|
|
]
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> children [
|
|
|
|
^ children
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> children: anEcSunburstSegment [
|
|
|
|
children := anEcSunburstSegment
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> color [
|
|
|
|
^ color
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> color: aColor [
|
|
|
|
color := aColor
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> isRoot [
|
|
|
|
^ value = 0
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> name [
|
|
|
|
^ name
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> name: string [
|
|
|
|
name := string
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> value [
|
|
|
|
^ value
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburstSegment >> value: number [
|
|
|
|
value := number
|
|
]
|