Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Seaside-Plotly-Core/JSScript.extension.st
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Extension { #name : #JSScript }
Extension { #name : 'JSScript' }

{ #category : #'*Seaside-Plotly-Core' }
{ #category : '*Seaside-Plotly-Core' }
JSScript >> plotly [
^ (PlotlyBuilder context: self renderContext)
rendererClass: self rendererClass;
yourself
]

{ #category : #'*Seaside-Plotly-Core' }
{ #category : '*Seaside-Plotly-Core' }
JSScript >> plotly: containerId [

^(self plotly)
Expand Down
32 changes: 17 additions & 15 deletions src/Seaside-Plotly-Core/PlotlyAxis.class.st
Original file line number Diff line number Diff line change
@@ -1,77 +1,79 @@
Class {
#name : #PlotlyAxis,
#superclass : #PlotlyObject,
#category : #'Seaside-Plotly-Core-Objects'
#name : 'PlotlyAxis',
#superclass : 'PlotlyObject',
#category : 'Seaside-Plotly-Core-Objects',
#package : 'Seaside-Plotly-Core',
#tag : 'Objects'
}

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> automargin: aBoolean [

self propertyAt: 'automargin' put: aBoolean
]

{ #category : #options }
{ #category : 'options' }
PlotlyAxis >> beFixedRange [

self fixedRange: true
]

{ #category : #options }
{ #category : 'options' }
PlotlyAxis >> fixedRange: aBoolean [

self propertyAt: 'fixedrange' put: aBoolean
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> showgrid: aBoolean [

self propertyAt: 'showgrid' put: aBoolean
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> tickDelta: aNumber [

self propertyAt: 'dtick' put: aNumber
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> tickSuffix: aString [

self propertyAt: 'ticksuffix' put: aString
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> tickmode: aString [

self propertyAt: 'tickmode' put: aString
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> ticks: position [

self propertyAt: 'ticks' put: position
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> ticksPosition: position [
"Alias for 'ticks' property, position can be one of 'outside', 'inside'."

self ticks: position
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> ticktext: aCollection [

self propertyAt: 'ticktext' put: aCollection
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> tickvals: aCollection [

self propertyAt: 'tickvals' put: aCollection
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyAxis >> zeroline: aBoolean [
self propertyAt: 'zeroline' put: aBoolean
]
75 changes: 37 additions & 38 deletions src/Seaside-Plotly-Core/PlotlyBuilder.class.st
Original file line number Diff line number Diff line change
@@ -1,51 +1,53 @@
Class {
#name : #PlotlyBuilder,
#superclass : #JSObject,
#name : 'PlotlyBuilder',
#superclass : 'JSObject',
#instVars : [
'method',
'containerId',
'parameters'
],
#category : #'Seaside-Plotly-Core-Builder'
#category : 'Seaside-Plotly-Core-Builder',
#package : 'Seaside-Plotly-Core',
#tag : 'Builder'
}

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> config [

^self parameters config
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> config: anObject [

self parameters config: anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> containerId [

^containerId
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> containerId: anObject [

containerId := anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> data: anObject [

self parameters data: anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> defaultMethod [

^'newPlot'
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> downloadImage: id settings: aDictionary [

self
Expand All @@ -55,80 +57,77 @@ PlotlyBuilder >> downloadImage: id settings: aDictionary [
yourself
]

{ #category : #initialization }
{ #category : 'initialization' }
PlotlyBuilder >> initialize [

super initialize.
self initializeParameters
]

{ #category : #initialization }
{ #category : 'initialization' }
PlotlyBuilder >> initializeParameters [

parameters := PlotlyBuilderParameters new
]

{ #category : #printing }
PlotlyBuilder >> javascriptContentOn: aStream [
| config |
aStream
nextPutAll: self plotlyGlobal;
nextPut: $.;
nextPutAll: self method;
nextPut: $(;
javascript: self containerId;
nextPutAll: ', ';
javascript: self parameters data;
nextPutAll: ', ';
javascript: self parameters layout;
nextPutAll: ', ';
javascript: self parameters config.
aStream nextPut: $)
]

{ #category : #accessing }
{ #category : 'printing' }
PlotlyBuilder >> javascriptContentOn: aJsCanvas [

aJsCanvas document
identifier: self plotlyGlobal;
dotProperty: self method.
aJsCanvas
arguments: [
aJsCanvas
argument: self containerId;
argument: self parameters data;
argument: self parameters layout;
argument: self parameters config ]
]

{ #category : 'accessing' }
PlotlyBuilder >> layout [

^self parameters layout
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> layout: anObject [

self parameters layout: anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> method [

^method ifNil: [method := self defaultMethod]
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> method: aString [

method := aString
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> parameters [

^parameters
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> parameters: anObject [

parameters := anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> plotlyGlobal [

^'Plotly'
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilder >> toImage: id settings: aDictionary [

self
Expand Down
16 changes: 9 additions & 7 deletions src/Seaside-Plotly-Core/PlotlyBuilderParameters.class.st
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
Class {
#name : #PlotlyBuilderParameters,
#superclass : #PlotlyObject,
#category : #'Seaside-Plotly-Core-Builder'
#name : 'PlotlyBuilderParameters',
#superclass : 'PlotlyObject',
#category : 'Seaside-Plotly-Core-Builder',
#package : 'Seaside-Plotly-Core',
#tag : 'Builder'
}

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilderParameters >> config [

^self properties at: 'config' ifAbsentPut: [PlotlyConfig new]
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilderParameters >> data [

^self properties at: 'data' ifAbsentPut: [OrderedCollection new]
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilderParameters >> frames [

^self properties at: 'frames' ifAbsentPut: [OrderedCollection new]
]

{ #category : #accessing }
{ #category : 'accessing' }
PlotlyBuilderParameters >> layout [

^self properties at: 'layout' ifAbsentPut: [PlotlyLayout new]
Expand Down
Loading