diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 5c1c3bac..f8b0b867 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -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/github-pages-deploy-action@v4.3.0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ab9243f1..31d539cd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,7 +28,7 @@ jobs: ${{ runner.os }}-gradle- - name: Publish Windows Artifacts if: matrix.os == 'windows-latest' - uses: gradle/gradle-build-action@v2.4.0 + uses: gradle/gradle-build-action@v2.4.2 with: arguments: | publishAllPublicationsToSpaceRepository @@ -37,7 +37,7 @@ jobs: -Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }} - name: Publish Mac Artifacts if: matrix.os == 'macOS-latest' - uses: gradle/gradle-build-action@v2.4.0 + uses: gradle/gradle-build-action@v2.4.2 with: arguments: | publishMacosX64PublicationToSpaceRepository diff --git a/README.md b/README.md index 9467f7c3..db8ee2b1 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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. diff --git a/plotlykt-core/src/commonMain/kotlin/space/kscience/plotly/plotExtensions.kt b/plotlykt-core/src/commonMain/kotlin/space/kscience/plotly/plotExtensions.kt index ae2df8cc..e99ccbfc 100644 --- a/plotlykt-core/src/commonMain/kotlin/space/kscience/plotly/plotExtensions.kt +++ b/plotlykt-core/src/commonMain/kotlin/space/kscience/plotly/plotExtensions.kt @@ -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) }