riot.js

How do I access child elements within riot.js

℡╲_俬逩灬. 提交于 2019-12-21 07:57:16
问题 If I have a custom riot tag with a p in it like this: <custom> <p>This is a text</p> </custom> How do I access the <p> element from within the <custom> tag? Update : I've received a whole bunch answers that are of ways to select it from the DOM. What I want is a way to select the inner p tag from within the component library riot.js itself. I'm looking for a more riotjs specific answer. For example with polymer you use this.$.content.getDistributedNodes() . 回答1: Riot only provides 4

Load multiple files using the d3-fetch module

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 20:14:05
问题 I try to load data from two different sources. After loading the data I want to use it within a riot tag file. But I do not understand how to load the second file, because I do not really understand the asynchronous call. What do I have to modify in my code to get the data? Right now, the second data object is undefined. Here is my code: import { csv, json } from 'd3-fetch' csv('/data/stations.csv', function (stations) { json('data/svg_data.json', function (svg) { return svg }) stations

Multiple anonymous defines in module Typescript with Riot-ts (Riotjs)

冷暖自知 提交于 2019-12-11 13:00:44
问题 Have to say that setting up the environment for Typescript is laborious and fraught with frustration. It's not a straight forward task by any means. Anyway: I am still trying to setup riot-ts with JSPM. I have gotten further along, but it's not working correctly. I now have the following: tsd.json: { "version": "v4", "repo": "borisyankov/DefinitelyTyped", "ref": "master", "path": "typings", "bundle": "typings/tsd.d.ts", "installed": { "jquery/jquery.d.ts": { "commit":

riotts (riot-ts) and jspm - anyone got it working together?

孤人 提交于 2019-12-06 13:09:56
I have been looking at this ambitious project https://github.com/nippur72/RiotTS that has moved riotjs over to riot-ts. The author has used bower, and I am trying to get it working using jspm. riot-ts doesn't exist in the jspm repo list, so I imported using jspm install npm:riot-ts package.json: { "jspm": { "directories": { "baseURL": "public/assets" }, "dependencies": { "riot-ts": "npm:riot-ts@^1.0.14" }, "devDependencies": { "babel": "npm:babel-core@^5.8.24", "babel-runtime": "npm:babel-runtime@^5.8.24", "core-js": "npm:core-js@^1.1.4" } }, "devDependencies": { "elixir-jasmine": "0.0.4",

How do I access child elements within riot.js

廉价感情. 提交于 2019-12-04 03:10:23
If I have a custom riot tag with a p in it like this: <custom> <p>This is a text</p> </custom> How do I access the <p> element from within the <custom> tag? Update : I've received a whole bunch answers that are of ways to select it from the DOM. What I want is a way to select the inner p tag from within the component library riot.js itself. I'm looking for a more riotjs specific answer. For example with polymer you use this.$.content.getDistributedNodes() . Riot only provides 4 properties to access data from the current tag you're in: this.opts this.parent this.root this.tags See the API docs

RiotJS - How to pass events between subtags using Observable pattern?

二次信任 提交于 2019-11-30 10:06:14
Im not really sure if Im understanding correctly the way observables work and how to get references from mounted tags. I have a component . Within this component we have a component and a component . The purpose is to avoid coupling between components. Because of that, I would like that my search component triggers an event when a search is done(a button is clicked). This event should be caught by the component which will filter the collection data based on the search. The index.html file load the tag by using: index.html riot.mount(".content", "page", null); The page is defined as follow:

RiotJS - How to pass events between subtags using Observable pattern?

天涯浪子 提交于 2019-11-29 15:33:50
问题 Im not really sure if Im understanding correctly the way observables work and how to get references from mounted tags. I have a component . Within this component we have a component and a component . The purpose is to avoid coupling between components. Because of that, I would like that my search component triggers an event when a search is done(a button is clicked). This event should be caught by the component which will filter the collection data based on the search. The index.html file

Load multiple files using the d3-fetch module

自古美人都是妖i 提交于 2019-11-29 11:14:27
I try to load data from two different sources. After loading the data I want to use it within a riot tag file. But I do not understand how to load the second file, because I do not really understand the asynchronous call. What do I have to modify in my code to get the data? Right now, the second data object is undefined. Here is my code: import { csv, json } from 'd3-fetch' csv('/data/stations.csv', function (stations) { json('data/svg_data.json', function (svg) { return svg }) stations.position_x = +stations.position_x stations.position_y = +stations.position_y stations.animation_time =