GithubHelp home page GithubHelp logo

spotless's Introduction

Spotless: Modern dev workflow for Spotfire scripts

This is a prototype.

It currently supports:

  • Loading Javascript code from a server outside of Spotfire (see DXP javascript "spotlessLoader")

  • Calling IronPython scripts from Javascript with or without parameters

spotless.callPython('userScript1', {testParam: 'I am a param passed from Javascript.'})
  • Setting Document Properties from Javscript
spotless.setDocProp('spotlessDebug', 'Page2 set this')
spotless.setDocProps({
  spotlessDebug: 'prop1 ' + spotless.randStr(),
  spotlessDebug2: 'prop2 ' + spotless.randStr()
})
  • Showing a Python MessageBox for debug purposes ("it's working!")
spotless.messageBox("Hello world from Javascript-to-Python.")

Trying Spotless

  1. Launch the spotless dev server:
npm install
npm start
  1. Open examples/Starter.dxp

  2. Code is currently only loaded from js/spotless-dev.js. To try spotless, edit this file and save your changes. When you switch tabs in Spotfire, all javascript code is reloaded from spotless-dev.js

  3. Use the Spotfire development console. Try running a Spotless command to get a feel for things.

spotless.messageBox("hello world")

Goals

Bring sanity and peace to Earth.

  • One file: JS source builds into a single JS file which can be hosted on CDN rather than staticly inside a DXP (webpack)
  • Source maps to ease debugging in Spotfire/chromium's dev console
  • Hot reloading: Spotfire browser reloads upon code change detected.
  • Bring your own IDE: liberate developers from Spotfire's JS code editor
  • Developer collaboration: Pull both JS and Python scripts out of DXP to enable git version control
  • SASS and CSS building, also to optionally be hosted on CDN rather than staticly inside of DXP
  • Unified error reporting between Python and JS (capture Python exceptions and print(), display in dev console)
  • Call Python scripts from Javascript
  • Call Javascript from Python
  • Blocking calls: wait or callback once Python script completes
  • Returning values from Python scripts to Javascript callback function
  • Bind Javascript variables to document properties

Notes

Useful for debugging Spotfire IronPython exceptions and print statements: (set debug level to Trace in Help menu)

tail -f Spotfire.Dxp.SupportDiagnostics.log | grep -E "spotlessProxy|IronPython"

spotless's People

Contributors

emersonian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.