Facebook Pixel

Electron Basic Template

This example shows how to build simple desktop application with AnyChart library and Electron.
View on GitHub

Running

To use this sample you must have:

NodeJS installed, if not please checkout NodeJS official site. To check your nodejs installation, run following command in command line:


$ node -v
v7.2.1 # sample output
            

npm package manager, if not please checkout npm official site. To check your npm installation, run following command in command line:


$ npm -v
3.10.10 # sample output
            

grunt task runner, if not please checkout grunt official site. To check your grunt installation, run following command in command line:


$ grunt --version
grunt-cli v1.2.0 # sample output
            

To start this example run commands listed below.

Clone the repository from github.com to your workspace folder:


$ git clone git@github.com:anychart-integrations/electron-template.git
            

Navigate to the repository folder:


$ cd electron-template
            

Install dependencies


npm install
            

To start application, run next command:


$ ./node_modules/.bin/electron .
            

To build application for your current platform run:


$ grunt electron:build
            

Now you can run packaged application. Navigate to generated build folder, e.g for linux x64 run:


$ cd dist/electron-template-linux-x64
            

And run application:


$ ./electron-template
            

To build application for all available platforms and architectures run:


$ grunt electron:buildAll
            

There will be many folders in dist directory corresponding to available platforms.


Workspace

Your workspace should look like:


electron-template/
    dist/					# generated builds
	node_modules/			# dependencies
    anychart-bundle.min.js	# anychart library
	anychart-ui.min.css		# anychart style
	main.js					# main Electron js script
	index.html				# main Electron html
	Gruntfile.js			# grunt
	package.json			# project settings
    README.md
    .gitignore
            

Technologies


Further Learning


License

AnyChart Electron integration sample includes two parts:

  • Code of the integration sample that allows to use Javascript library (in this case, AnyChart) with Electron. You can use, edit, modify it, use it with other Javascript libraries without any restrictions. It is released under Apache 2.0 License.
  • AnyChart JavaScript library. It is released under Commercial license. You can test this plugin with the trial version of AnyChart. Our trial version is not limited by time and doesn't contain any feature limitations. Check details here.

If you have any questions regarding licensing - please contact us. sales@anychart.com