Skip to content

Commit

Permalink
Merge remote-tracking branch 'space/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
altavir committed Jul 29, 2023
2 parents 385dc05 + 981b1a3 commit b75bef2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: gradle/gradle-build-action@v2.1.5
- uses: gradle/gradle-build-action@v2.4.2
with:
arguments: dokkaHtmlMultiModule --no-parallel
- uses: JamesIves/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
${{ runner.os }}-gradle-
- name: Publish Windows Artifacts
if: matrix.os == 'windows-latest'
uses: gradle/[email protected].0
uses: gradle/[email protected].2
with:
arguments: |
publishAllPublicationsToSpaceRepository
Expand All @@ -37,7 +37,7 @@ jobs:
-Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}
- name: Publish Mac Artifacts
if: matrix.os == 'macOS-latest'
uses: gradle/[email protected].0
uses: gradle/[email protected].2
with:
arguments: |
publishMacosX64PublicationToSpaceRepository
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ See [simpleServer](./examples/src/main/kotlin/simpleServer.kt) and
## Kotlin-JS
Plotly is a JavaScript library, yet it is convenient to have a type-safe API when using in with Kotlin-JS. The sample application is available in [js-demo](./js-demo) module. One should node that Plotly.kt for JS is not a zero-cost wrapper like TypeScript definitions, it maintains its own object structure, could generate stand-alone models and some internal optimizations.

**Plotly-kt does not support `LEGACY` JS target. Be sure to use [IR compiler](https://kotlinlang.org/docs/js-ir-compiler.html)**

## JavaFX browser
Plotly.kt could be run in a JavaFX browser. An example project is presented in [fx-demo](./fx-demo).

Expand All @@ -58,9 +60,9 @@ The examples of the notebooks are shown in [notebooks](./examples/notebooks) dir
//@file:DependsOn("space.kscience:plotlykt-server:$version") // Use this one for sever integration.
```

The module `plotly` allows rendering static plots in Jupyter. Jupyter lab is currently supported. Jupyter notebook (classic) is able to render only `PlotlyPage` objects, so one must convert plots to pages to be able to use notebook (see [demo notebook](./notebooks/plotlykt-demo-classic.ipynb)).
The module `plotly` allows rendering static plots in Jupyter. Jupyter lab is currently supported. Jupyter notebook (classic) is able to render only `PlotlyPage` objects, so one must convert plots to pages to be able to use notebook (see [demo notebook](./examples/notebooks/plotlykt-demo.ipynb)).

The module `plotly-server` adds server capabilities and allows to render dynamic plots in notebooks (see [demo notebook](./notebooks/plotlykt-server-demo.ipynb)). One must note that for dynamic pages, one must pass `renderer` parameter explicitly to plot like it is done in examples.
The module `plotly-server` adds server capabilities and allows to render dynamic plots in notebooks (see [demo notebook](./examples/notebooks/plotlykt-server-demo.ipynb)). One must note that for dynamic pages, one must pass `renderer` parameter explicitly to plot like it is done in examples.

**IMPORTANT:** By default, Plotly-kt jupyter integration is configured to work with Jupyter Lab frontend, which renders all cells in the same page. Jupyter classic notebook and DataLore use cell isolation with iframes, so you will see blanks instead of plots. It could be fixed by switching into a notebook mode by running `Plotly.jupyter.notebook()` in a cell after plotly library is loaded.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public inline fun Plot.table(block: Table.() -> Unit): Table {
return trace
}

public inline fun Plot.candlestick(block: CandleStick.() -> Unit): CandleStick {
val trace = CandleStick(block)
traces(trace)
return trace
}

public fun Plot.text(block: Text.() -> Unit) {
layout.annotation(block)
}
Expand Down

0 comments on commit b75bef2

Please sign in to comment.