Skip to content

Commit de05ca2

Browse files
authored
Merge pull request #432 from sven42/task/add-properties
Add new properties for Histogram and layout.Axis
2 parents 7cc95e1 + 42ffa62 commit de05ca2

File tree

87 files changed

+1530
-1353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1530
-1353
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# activate meaningful git annotations with:
2+
# git config blame.ignoreRevsFile .git-blame-ignore-revs
3+
4+
# scalafmt
5+
0ad886c35bdf9c8ad2bfb0501070b8b2ce810710

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
SCALA_VERSION: ["2.12.17", "2.13.10"]
16+
SCALA_VERSION: ["2.12.19", "2.13.14"]
1717
steps:
1818
- uses: actions/checkout@v3
1919
- uses: coursier/cache-action@v6

.scalafmt.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version = "3.8.1"
2+
3+
runner.dialect = scala213
4+
5+
preset = defaultWithAlign
6+
7+
maxColumn = 120
8+
9+
assumeStandardLibraryStripMargin = true
10+
11+
align {
12+
arrowEnumeratorGenerator = true
13+
}
14+
15+
newlines {
16+
penalizeSingleSelectMultiArgList = true
17+
}
18+
19+
rewrite {
20+
rules = [Imports, PreferCurlyFors, RedundantParens]
21+
imports.sort = scalastyle
22+
}
23+
24+
docstrings.wrap=no
25+
26+
// only format files tracked by git
27+
project.git = true

almond/src/main/scala/plotly/Almond.scala

Lines changed: 110 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ object Almond {
2020

2121
val requireInit =
2222
if (offline)
23-
s"""define('plotly', function(require, exports, module) {
24-
| ${Plotly.plotlyMinJs}
25-
|});
23+
s"""define('plotly', function(require, exports, module) {
24+
| ${Plotly.plotlyMinJs}
25+
|});
2626
""".stripMargin
2727
else
2828
s"""require.config({
29-
| paths: {
30-
| d3: 'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min',
31-
| plotly: 'https://cdn.plot.ly/plotly-${Plotly.plotlyVersion}.min',
32-
| jquery: 'https://code.jquery.com/jquery-3.3.1.min'
33-
| },
34-
|
35-
| shim: {
36-
| plotly: {
37-
| deps: ['d3', 'jquery'],
38-
| exports: 'plotly'
39-
| }
40-
| }
41-
|});
29+
| paths: {
30+
| d3: 'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min',
31+
| plotly: 'https://cdn.plot.ly/plotly-${Plotly.plotlyVersion}.min',
32+
| jquery: 'https://code.jquery.com/jquery-3.3.1.min'
33+
| },
34+
|
35+
| shim: {
36+
| plotly: {
37+
| deps: ['d3', 'jquery'],
38+
| exports: 'plotly'
39+
| }
40+
| }
41+
|});
4242
""".stripMargin
4343

4444
val html = s"""
@@ -57,12 +57,12 @@ object Almond {
5757
}
5858

5959
def plotJs(
60-
data: Seq[Trace],
61-
layout: Layout,
62-
config: Config,
63-
div: String = ""
60+
data: Seq[Trace],
61+
layout: Layout,
62+
config: Config,
63+
div: String = ""
6464
)(implicit
65-
publish: OutputHandler
65+
publish: OutputHandler
6666
): String = {
6767

6868
val (div0, divPart) =
@@ -73,12 +73,12 @@ object Almond {
7373
(div, "")
7474

7575
val baseJs = Plotly.jsSnippet(div0, data, layout, config)
76-
val json = Plotly.jsonSnippet(data, layout, config)
76+
val json = Plotly.jsonSnippet(data, layout, config)
7777

7878
val js =
79-
s"""require(['plotly'], function(Plotly) {
80-
| $baseJs
81-
|});
79+
s"""require(['plotly'], function(Plotly) {
80+
| $baseJs
81+
|});
8282
""".stripMargin
8383

8484
val data0 = DisplayData(
@@ -100,12 +100,12 @@ object Almond {
100100
almond.display.UpdatableDisplay.generateDiv("plot-")
101101

102102
def plot(
103-
data: Seq[Trace],
104-
layout: Layout = Layout(),
105-
config: Config = Config(),
106-
div: String = ""
103+
data: Seq[Trace],
104+
layout: Layout = Layout(),
105+
config: Config = Config(),
106+
div: String = ""
107107
)(implicit
108-
publish: OutputHandler
108+
publish: OutputHandler
109109
): String = {
110110

111111
if (!Internal.initialized)
@@ -123,39 +123,39 @@ object Almond {
123123

124124
@deprecated("Create a Layout and / or a Config, and call one of the other plot methods instead", "0.8.0")
125125
def plot(
126-
title: String = null,
127-
legend: Legend = null,
128-
width: JInt = null,
129-
height: JInt = null,
130-
showlegend: JBoolean = null,
131-
xaxis: Axis = null,
132-
yaxis: Axis = null,
133-
xaxis1: Axis = null,
134-
xaxis2: Axis = null,
135-
xaxis3: Axis = null,
136-
xaxis4: Axis = null,
137-
yaxis1: Axis = null,
138-
yaxis2: Axis = null,
139-
yaxis3: Axis = null,
140-
yaxis4: Axis = null,
141-
barmode: BarMode = null,
142-
autosize: JBoolean = null,
143-
margin: Margin = null,
144-
annotations: Seq[Annotation] = null,
145-
plot_bgcolor: Color = null,
146-
paper_bgcolor: Color = null,
147-
font: Font = null,
148-
bargap: JDouble = null,
149-
bargroupgap: JDouble = null,
150-
hovermode: HoverMode = null,
151-
boxmode: BoxMode = null,
152-
editable: JBoolean = null,
153-
responsive: JBoolean = null,
154-
showEditInChartStudio: JBoolean = null,
155-
plotlyServerURL: String = null,
156-
div: String = ""
126+
title: String = null,
127+
legend: Legend = null,
128+
width: JInt = null,
129+
height: JInt = null,
130+
showlegend: JBoolean = null,
131+
xaxis: Axis = null,
132+
yaxis: Axis = null,
133+
xaxis1: Axis = null,
134+
xaxis2: Axis = null,
135+
xaxis3: Axis = null,
136+
xaxis4: Axis = null,
137+
yaxis1: Axis = null,
138+
yaxis2: Axis = null,
139+
yaxis3: Axis = null,
140+
yaxis4: Axis = null,
141+
barmode: BarMode = null,
142+
autosize: JBoolean = null,
143+
margin: Margin = null,
144+
annotations: Seq[Annotation] = null,
145+
plot_bgcolor: Color = null,
146+
paper_bgcolor: Color = null,
147+
font: Font = null,
148+
bargap: JDouble = null,
149+
bargroupgap: JDouble = null,
150+
hovermode: HoverMode = null,
151+
boxmode: BoxMode = null,
152+
editable: JBoolean = null,
153+
responsive: JBoolean = null,
154+
showEditInChartStudio: JBoolean = null,
155+
plotlyServerURL: String = null,
156+
div: String = ""
157157
)(implicit
158-
publish: OutputHandler
158+
publish: OutputHandler
159159
): String =
160160
plot(
161161
Layout(
@@ -195,77 +195,77 @@ object Almond {
195195
)
196196

197197
def plot(
198-
layout: Layout,
199-
config: Config,
200-
div: String
198+
layout: Layout,
199+
config: Config,
200+
div: String
201201
)(implicit
202-
publish: OutputHandler
202+
publish: OutputHandler
203203
): String =
204204
Almond.plot(Seq(data), layout, config, div = div)
205205

206206
def plot()(implicit
207-
publish: OutputHandler
207+
publish: OutputHandler
208208
): String =
209209
plot(Layout(), Config(), "")
210210

211211
def plot(
212-
layout: Layout
212+
layout: Layout
213213
)(implicit
214-
publish: OutputHandler
214+
publish: OutputHandler
215215
): String =
216216
plot(layout, Config(), "")
217217

218218
def plot(
219-
config: Config
219+
config: Config
220220
)(implicit
221-
publish: OutputHandler
221+
publish: OutputHandler
222222
): String =
223223
plot(Layout(), config, "")
224224

225225
def plot(
226-
layout: Layout,
227-
config: Config
226+
layout: Layout,
227+
config: Config
228228
)(implicit
229-
publish: OutputHandler
229+
publish: OutputHandler
230230
): String =
231231
plot(layout, config, "")
232232
}
233233

234234
implicit class DataSeqOps(val data: Seq[Trace]) extends AnyVal {
235235
def plot(
236-
title: String = null,
237-
legend: Legend = null,
238-
width: JInt = null,
239-
height: JInt = null,
240-
showlegend: JBoolean = null,
241-
xaxis: Axis = null,
242-
yaxis: Axis = null,
243-
xaxis1: Axis = null,
244-
xaxis2: Axis = null,
245-
xaxis3: Axis = null,
246-
xaxis4: Axis = null,
247-
yaxis1: Axis = null,
248-
yaxis2: Axis = null,
249-
yaxis3: Axis = null,
250-
yaxis4: Axis = null,
251-
barmode: BarMode = null,
252-
autosize: JBoolean = null,
253-
margin: Margin = null,
254-
annotations: Seq[Annotation] = null,
255-
plot_bgcolor: Color = null,
256-
paper_bgcolor: Color = null,
257-
font: Font = null,
258-
bargap: JDouble = null,
259-
bargroupgap: JDouble = null,
260-
hovermode: HoverMode = null,
261-
boxmode: BoxMode = null,
262-
editable: JBoolean = null,
263-
responsive: JBoolean = null,
264-
showEditInChartStudio: JBoolean = null,
265-
plotlyServerURL: String = null,
266-
div: String = ""
236+
title: String = null,
237+
legend: Legend = null,
238+
width: JInt = null,
239+
height: JInt = null,
240+
showlegend: JBoolean = null,
241+
xaxis: Axis = null,
242+
yaxis: Axis = null,
243+
xaxis1: Axis = null,
244+
xaxis2: Axis = null,
245+
xaxis3: Axis = null,
246+
xaxis4: Axis = null,
247+
yaxis1: Axis = null,
248+
yaxis2: Axis = null,
249+
yaxis3: Axis = null,
250+
yaxis4: Axis = null,
251+
barmode: BarMode = null,
252+
autosize: JBoolean = null,
253+
margin: Margin = null,
254+
annotations: Seq[Annotation] = null,
255+
plot_bgcolor: Color = null,
256+
paper_bgcolor: Color = null,
257+
font: Font = null,
258+
bargap: JDouble = null,
259+
bargroupgap: JDouble = null,
260+
hovermode: HoverMode = null,
261+
boxmode: BoxMode = null,
262+
editable: JBoolean = null,
263+
responsive: JBoolean = null,
264+
showEditInChartStudio: JBoolean = null,
265+
plotlyServerURL: String = null,
266+
div: String = ""
267267
)(implicit
268-
publish: OutputHandler
268+
publish: OutputHandler
269269
): String =
270270
plot(
271271
Layout(
@@ -305,11 +305,11 @@ object Almond {
305305
)
306306

307307
def plot(
308-
layout: Layout,
309-
config: Config,
310-
div: String
308+
layout: Layout,
309+
config: Config,
310+
div: String
311311
)(implicit
312-
publish: OutputHandler
312+
publish: OutputHandler
313313
): String =
314314
Almond.plot(data, layout, config, div = div)
315315
}

0 commit comments

Comments
 (0)