scaladget


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

fr.iscpif
ArtifactId

ArtifactId

scaladget_sjs0.5_2.11
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

scaladget
scaladget
Project URL

Project URL

https://github.com/mathieuleclaire/scaladget
Project Organization

Project Organization

fr.iscpif
Source Code Management

Source Code Management

https://github.com/mathieuleclaire/scaladget.git

Download scaladget_sjs0.5_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/fr.iscpif/scaladget_sjs0.5_2.11/ -->
<dependency>
    <groupId>fr.iscpif</groupId>
    <artifactId>scaladget_sjs0.5_2.11</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/fr.iscpif/scaladget_sjs0.5_2.11/
implementation 'fr.iscpif:scaladget_sjs0.5_2.11:0.2.0'
// https://jarcasting.com/artifacts/fr.iscpif/scaladget_sjs0.5_2.11/
implementation ("fr.iscpif:scaladget_sjs0.5_2.11:0.2.0")
'fr.iscpif:scaladget_sjs0.5_2.11:jar:0.2.0'
<dependency org="fr.iscpif" name="scaladget_sjs0.5_2.11" rev="0.2.0">
  <artifact name="scaladget_sjs0.5_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='fr.iscpif', module='scaladget_sjs0.5_2.11', version='0.2.0')
)
libraryDependencies += "fr.iscpif" % "scaladget_sjs0.5_2.11" % "0.2.0"
[fr.iscpif/scaladget_sjs0.5_2.11 "0.2.0"]

Dependencies

compile (7)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.4
org.scala-lang.modules.scalajs » scalajs-library_2.11 jar 0.5.6
com.github.scala-incubator.io : scala-io-core_2.11 jar 0.4.3
org.scala-lang.modules.scalajs » scalajs-dom_sjs0.5_2.11 jar 0.6
org.scala-lang.modules.scalajs » scalajs-jquery_sjs0.5_2.11 jar 0.6
com.scalatags : scalatags_sjs0.5_2.11 jar 0.4.2
com.scalarx : scalarx_sjs0.5_2.11 jar 0.2.6

Project Modules

There are no modules declared in this project.

scaladget

Scaladget provides a scala facades of some famous javascript libraries. It relies on the scala-js project. Among them:

Usage

Just add this to your dependencies:

  libraryDependencies += "fr.iscpif.scaladget" %%% "bootstrapnative" % scaladgetVersion
  libraryDependencies += "fr.iscpif.scaladget" %%% "ace" % scaladgetVersion
  libraryDependencies += "fr.iscpif.scaladget" %%% "bootstrapslider" % scaladgetVersion
  libraryDependencies += "fr.iscpif.scaladget" %%% "lunr" % scaladgetVersion

Current version : see release tags section

All the facades are intensively used in the OpenMOLE project.

Bootstrap-native library

Demo

The boostrap-native facade (based on https://thednp.github.io/bootstrap.native/) renders transparent the use of buttons, forms, modals, tables, collapsers, selectors etc...

Imports:

import scaladget.bootstrapnative.bsn._

Here is an example of bootstrap modal dialog creation in full scala:

    import scalatags.JsDom.tags
    
    // Create the Modal dialog
    val modalDialog: ModalDialog =
      ModalDialog(
        onopen = ()=> println("OPEN"),
        onclose = ()=> println("CLOSE")
      )

    // Append header, body, footer elements
    modalDialog header div("Header")
    modalDialog footer buttonGroup()(
      ModalDialog.closeButton(modalDialog, btn_info, "OK"),
      ModalDialog.closeButton(modalDialog, btn_default, "Cancel")
    )

    // Build the dialog and the modal dialog
    tags.span(
      modalDialog.dialog,
      button("Modal !", onclick := {() => modalDialog.show}, btn_primary, marginLeft := 5),
      tags.span(glyph_settings, paddingLeft := 5, pointer, onclick := {()=> modalDialog.show})

modal

And here an example for a dynamic collapser:

buttonIcon("Trigger !", btn_primary).expandOnclick(panel("My text in detail")(width := 400))

trigger

triggered

Find more examples on the: API Demo Here is an example of scaladget intensive use in the OpenMOLE project

Bootstrap-slider library

See rendering in the API Demo

bootstrapslider

SVG rendering

A SVG API for rendering typed path in SVG is provided. it is compatible with scalatags. See a simple example here

svg

An example using the scaladget SVG tool and reactive library scala.rx can be found in this demo. It reproduces this D3 flowchart.

flowchart

Versions

Version
0.2.0
0.1.0