Skip to main content
100%

Hello World

✓ Published0🌍 Public
GGordonSmith
Last edited Aug 8, 2018
Created on Dec 29, 2015

This example displays a simple "Hello World!" message using the `TextBox` widget from the `@hpcc-js/common` library. It demonstrates the basic pattern of importing a visualization class, setting its published properties—such as the target HTML element and text content—and rendering it. The code uses `System.import` via the GetLibs module loader to load the JavaScript, while the widget is styled through a separate CSS file that fills the viewport. No external data source is involved; the text is hardcoded in the widget configuration.

AI-generated description

Tutorial 1: The mandatory "Hello World" example.

Demonstrates how to import and instanciate a simple TextBox "Widget".

1 - Import the required visualization:

import { TextBox } from "@hpcc-js/common";

2 - Instantiate and render the visualisation:

var widget = new TextBox()  //  Create new instance of TextBox
    .target("placeholder")  //  Nominate target on web page 
    .text("Hello\nWorld!")  //  Set a "published property"
    .render()               //  Render
;

Note: To discover all the available "published properties" for the TextBox Widget see: Dermatology-TextBox and enable the "Properties" view.

apache-2.0 Licensed

Similar vizzes