Giter Club home page Giter Club logo

lightstreamer-example-stocklist-client-dojo's Introduction

Lightstreamer - Stock-List Demo - HTML (Dojo Toolkit) Client

A simple stocklist demo application showing integration between the Dojo Toolkit and the Lightstreamer JavaScript Client library.

screenshot

An online demonstration is hosted on our servers at http://demos.lightstreamer.com/DojoDemo

The demo shows how to use the Lightstreamer JavaScript Client library, the lightstreamer-store, the dgrid component and DojoX Charts together.

Real-Time simulated Stock-List data is received from the Lightstreamer Server deployed @ http://push.lightstreamer.com
To deploy the demo on your own environment follow the below instructions.

Deploy

Before you can run the demo some dependencies need to be solved:

  • Get the lightstreamer_namespace.js file from the latest Lightstreamer distribution and put it in the src folder of the demo. Alternatively you can build a lightstreamer_namespace.js file from the online generator. In that case be sure to include the LightstreamerClient, Subscription and StatusWidget modules and to use the "AMD with namespaced names" version.
  • Download the Dojo Toolkit and copy the dojox folder from the package to the src folder of the demo. The demo requires the Dojo Toolkit v.1.8 or higher.
  • Using the CommonJS Package Manager install dgrid, dijit and lightstreamer-store in the src folder; dependencies for these packages will be automatically resolved by the cpm process: cpm install dgrid cpm install dijit cpm install lightstreamer-store

Dojo Build

It is suggested to compress the dojo/dojox/dijit files in a single js source file to minimize startup times:

Head for the Dojo Web Builder and select the following packages:

  • dijit.layout.BorderContainer
  • dijit.Dialog
  • dijit.registry
  • dojox.charting.Chart
  • dojox.charting.StoreSeries
  • dojox.charting.axis2d.Default
  • dojox.charting.plot2d.Default
  • dojox.charting.themes.Claro
  • dijit.form.ToggleButton
  • dojo.store.Memory
  • dojo.store.Observable
  • dojo.parser
  • dojo.domReady
  • dijit.layout.ContentPane
  • dijit.form.Button
  • dojox.collections.Dictionary
  • dojox.collections.ArrayList
  • dojox.gfx.svg

Then click the "build" button and wait. Once the builder is done a zip file will be dowloaded; copy the files/folders from the archive in the src/dojo foloder and reload the demo.

The demo is now ready to be launched: navigate to src/index.html and enjoy.

Once the demo is working in your environment it is time to deploy it on a web server.

The demo currently connects to an online Lightstreamer demo server to get the stock data. It is possible to change this setting making the demo point to a different server. Obviously in this case the DEMO adapter needs to be installed on the tagert server (currently such adapter is installed by default). To change the server edit the js/lsClient.js file and substitute the following line:

    var lsClient = new LightstreamerClient(protocolToUse+"//localhost:"+portToUse,"DEMO");

with:

    var lsClient = new LightstreamerClient(myServer,"DEMO");

where myServer contains the address of the server (comprehending the port if different from the default one). As an example, to connect to a local server listening on port 8080 use:

    var lsClient = new LightstreamerClient("http://localhost:8080","DEMO");

See Also

Lightstreamer Adapters Needed by This Demo Client

Related Projects

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer JavaScript Client library version 6.0 or newer.
  • Compatible with Dojo Toolkit v.1.8 or newer.

lightstreamer-example-stocklist-client-dojo's People

Contributors

bravo27 avatar dylans avatar marcotesta avatar mone 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.