Directory

← Back

xtal-treant

Web component wrapper around treant library

Author

Rating

Popularity

<100

Published on webcomponents.org

<xtal-treant>

xtal-treant is a dependency free web component wrapper around the great Treant library.

The web component requires a property, "config" to be set:

<xtal-treant config="[[treeBeard]]"></xtal-treant>

Because the library is designed to create different tree charts, based on a passed on css file, this raises a bit of a cunnundrum for a reusable web component. You can pass in the css file in the config setting. This will dynamically pass the css content into the shadow DOM. This currently has some issues in Chrome.

So the better alternative is to define a preload link in document.head:

<link class="treant css" relx="preload" as="fetch" href="../examples/basic-example/basic-example.css" data-postfix="basic">

Note the use of "treant" and "css" in the class, and the data-postfix value.

This will cause xtal-treant to dynamically create a new web component with name xtal-treant-basic, with the contents of the css file stamped into the template.

Install the Polymer-CLI

First, make sure you have the Polymer CLI installed. Then run polymer serve to serve your element locally.

Viewing Your Element

$ polymer serve

Running Tests

WIP

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

  • treant-js#^1.0.1
  • xtal-latx#0.0.44
Released
2018-10-11
Maturity
IMPORTED
License
MIT License

Compatibility

Framework
Browser
Browser Independent

xtal-treant - Vaadin Add-on Directory

Web component wrapper around treant library xtal-treant - Vaadin Add-on Directory
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/xtal-treant) # \ xtal-treant is a dependency free web component wrapper around the great [Treant](http://fperucic.github.io/treant-js/) library. The web component requires a property, "config" to be set: ```html ``` Because the library is designed to create different tree charts, based on a passed on css file, this raises a bit of a cunnundrum for a reusable web component. You can pass in the css file in the config setting. This will dynamically pass the css content into the shadow DOM. [This currently has some issues in Chrome](https://github.com/Polymer/polymer/issues/4865). So the better alternative is to define a preload link in document.head: ```html ``` Note the use of "treant" and "css" in the class, and the data-postfix value. This will cause xtal-treant to dynamically create a new web component with name xtal-treant-basic, with the contents of the css file stamped into the template. ## Install the Polymer-CLI First, make sure you have the [Polymer CLI](https://www.npmjs.com/package/polymer-cli) installed. Then run `polymer serve` to serve your element locally. ## Viewing Your Element ``` $ polymer serve ``` ## Running Tests WIP
Online