Giter Club home page Giter Club logo

integration-widget-template's Introduction

Pie chart My TS widget template

A template to build a pie chart widget.

Prerequisites

  • git
  • node 8.12
  • yarn 1.10.1

Commands

All those commands must be run in a terminal in the repository folder.

Download the dependencies (needed as the first command after a checkout)

yarn install

Build the package for production

yarn build

Launch the testing tool

yarn display

When the widget is successfully built, it creates a folder dist with a main.bundle.js inside. When the widget is ready you can send the file to Talentsoft.

Project description

package.json: node package description

tsconfig.json: typescript compiler options

webpack.config.js: build setup

widget.conf.json: the widget configuration. The widgetName key identifies this widget for talentsoft.

resources: contains one file per supported language. Each file must contain the same set of resource keys and the corresponding text in the file's language.

asset: contains the less files needed for the widget display.

app: contains the app code. The main file (as configured in webpack.config.js is widget.tsx). This file must export a Widget class the defines a react component.

Css management

All style information must be included in the javascript bundle. With this project you can acheive this behavior by importing less files (see import '../asset/widget.less'; in widget.tsx). The less will be compiled to css and put into a function that will insert it in the widget's html body when it is loaded.

If you want to use a different preprocessor or directly css you can edit the webpack configuration.

Host api

The widget receive a number of properties that allows it to communicate with the host page. It receives data (current language, display mode, etc) and can send information using the provided methods (eg to notify the host that the loading has finished).

You can find the host api reference here: Host api reference

Testing

It is recommended to use the testing tool by running the yarn display command.

The testing tool will simulate the environment by providing a mock for the host api. You can customize those mocks by modififying the mock file located here.

For more information please see this link.

integration-widget-template's People

Contributors

adlane98 avatar mkehyayants avatar rcheck avatar sbergotts avatar

Watchers

 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.