Skip to content

Commit

Permalink
Merge pull request #430 from gemini-hlsw/pr/fix-highcharts
Browse files Browse the repository at this point in the history
Fix highcharts imports
  • Loading branch information
armanbilge authored Apr 24, 2023
2 parents fea2c86 + cbf606a commit 30fa5d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 9 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,21 @@ lazy val tanstackTableDemo = project

lazy val highcharts = project
.in(file("highcharts"))
.enablePlugins(ScalaJSPlugin)
.enablePlugins(ScalaJSPlugin, ScalaJSImportMapPlugin)
.dependsOn(common, resizeDetector)
.settings(
name := "lucuma-react-highcharts",
name := "lucuma-react-highcharts",
Compile / scalacOptions += "-language:implicitConversions",
libraryDependencies ++= Seq(
"edu.gemini" %%% "lucuma-typed-highcharts" % lucumaTypedV
),
facadeSettings
facadeSettings,
Test / scalaJSImportMap := {
case "highcharts/es-modules/masters/highcharts.src.js" => "highcharts"
case "highcharts/es-modules/masters/modules/accessibility.src.js" =>
"highcharts/modules/accessibility"
case other => other
}
)

lazy val highchartsDemo = project
Expand Down
4 changes: 2 additions & 2 deletions highcharts/src/main/scala/react/highcharts/Chart.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import scala.scalajs.js.|
trait WrapProceed extends js.ThisFunction0[Chart_, Unit]

@js.native
@JSImport("highcharts", JSImport.Default)
@JSImport("highcharts/es-modules/masters/highcharts.src.js", JSImport.Default)
object Highcharts extends TypeofHighchartsAST {
@JSName("wrap")
def wrapThis(
Expand All @@ -34,7 +34,7 @@ object Highcharts extends TypeofHighchartsAST {
}

@js.native
@JSImport("highcharts/modules/accessibility", JSImport.Default)
@JSImport("highcharts/es-modules/masters/modules/accessibility.src.js", JSImport.Default)
object HighchartsAccesibility extends js.Object

case class Chart(
Expand Down
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
val sbtLucumaVersion = "0.10.12"
addSbtPlugin("edu.gemini" % "sbt-lucuma-lib" % sbtLucumaVersion)
addSbtPlugin("edu.gemini" % "sbt-lucuma-lib" % sbtLucumaVersion)
addSbtPlugin("com.armanbilge" % "sbt-scalajs-importmap" % "0.1.0")

libraryDependencies += "edu.gemini" %% "lucuma-jsdom" % sbtLucumaVersion

Expand Down

0 comments on commit 30fa5d6

Please sign in to comment.