Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MonolithicJS to js-package #55

Merged
merged 3 commits into from
Nov 7, 2019
Merged
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
12 changes: 10 additions & 2 deletions js-package/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ kotlin {
implementation project(':base')
implementation project(':mapper-core')
implementation project(':vis-svg')
implementation project(':vis-canvas')
implementation project(':vis-svg-mapper')
implementation project(':plot-base-portable')
implementation project(':plot-base')
Expand All @@ -32,7 +33,6 @@ kotlin {
implementation project(':plot-builder')
implementation project(':plot-config-portable')
implementation project(':plot-config')
implementation project(':plot-app')

if (project.buildSettings.enable_livemap) {
implementation project(':gis')
Expand All @@ -46,6 +46,15 @@ kotlin {
jsMain {
dependencies {
implementation kotlin('stdlib-js')
implementation "io.github.microutils:kotlin-logging-js:$kotlinLogging_version"

implementation project(':mapper-core')
implementation project(':vis-svg-mapper')
}
}
jsTest {
dependencies {
implementation kotlin('test-js')
}
}
}
Expand Down Expand Up @@ -193,7 +202,6 @@ dependencies {
projectDependenciesJs project(':plot-builder')
projectDependenciesJs project(':plot-config-portable')
projectDependenciesJs project(':plot-config')
projectDependenciesJs project(':plot-app')
}

// ---------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import jetbrains.datalore.plot.builder.Plot
import jetbrains.datalore.plot.builder.PlotContainer
import jetbrains.datalore.plot.builder.assemble.PlotAssembler
import jetbrains.datalore.plot.config.*
import jetbrains.datalore.plot.injectLiveMap
import jetbrains.datalore.plot.livemap.LiveMapUtil
import jetbrains.datalore.plot.server.config.PlotConfigServerSide
import jetbrains.datalore.vis.canvas.dom.DomCanvasControl
import jetbrains.datalore.vis.svg.SvgNodeContainer
Expand Down Expand Up @@ -111,7 +111,13 @@ private fun buildPlotFromProcessedSpecsIntern(
}
}

injectLiveMap(plotSpec, assembler)
LiveMapOptionsParser.parseFromPlotOptions(OptionsAccessor(plotSpec))
?.let {
LiveMapUtil.injectLiveMapProvider(
assembler.layersByTile,
it
)
}

val plot = assembler.createPlot()
val svg = buildPlotSvg(plot, plotSize, parentElement)
Expand Down
5 changes: 3 additions & 2 deletions js-package/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ const webpack = require('webpack');

const buildPath = path.resolve(__dirname, 'build');
const libPath = path.resolve(buildPath, 'js');
const jsPackagePath = path.resolve(buildPath, 'classes', 'kotlin', 'js', 'main');
const distPath = path.resolve(buildPath, 'dist');

module.exports = {
entry: `${libPath}/plot-app.js`,
entry: `${jsPackagePath}/js-package.js`,
output: {
library: 'DatalorePlot',
path: distPath,
libraryTarget: 'window',
globalObject: 'window'
},
resolve: {
modules: [libPath, 'node_modules']
modules: [libPath, jsPackagePath, 'node_modules']
},
plugins: [
new webpack.IgnorePlugin(/^(ws|text-encoding)$/)
Expand Down
93 changes: 0 additions & 93 deletions plot-app/build.gradle

This file was deleted.

25 changes: 0 additions & 25 deletions plot-app/src/commonMain/kotlin/jetbrains.datalore.plot/Utils.kt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ include 'base-portable',
'plot-builder',
'plot-config-portable',
'plot-config',
'plot-app',
'vis-demo-common',
'vis-demo-common-jfx',
'vis-demo-svg-mapper',
Expand Down