Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Data Tree support #6

Open
bhowes-tt opened this issue Mar 9, 2021 · 2 comments
Open

Input Data Tree support #6

bhowes-tt opened this issue Mar 9, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@bhowes-tt
Copy link
Member

@hanshenSun - Swap might want to call the API and pass data trees of inputs (instead of items and lists). We'd need to adjust so that everything doesn't get assigned to the '0' path here:

CORE.Swarm.jspkg/index.js

Lines 349 to 352 in 357cf5e

newInput.InnerTree["{ 0; }"] = tree;
newInput.Keys = ["{ 0; }"];
newInput.Values = tree;

@bhowes-tt bhowes-tt added the enhancement New feature or request label Mar 9, 2021
@hanshenSun
Copy link
Contributor

Can you provide me an example of how the data structure would look like? @eertugrul

@eertugrul
Copy link
Member

@hanshenSun
not sure whether you checked how we format swarm inputs, might be give some hint
https://github.com/tt-acm/CORE.Swarm.WebApp/blob/76e2cc4d54084d4dc7f231ebcd8022e0ef3c5c78/browser/main/es6/components/viewer/viewer.dashboard.vue#L697-L782

currently Swarm jspkg design to add one arrayValue to the innerTree. InnerTree of each input and output can have multiple keys and values. You need to support two different case, List and Datatree. DataTree would require to set multiple keys of the while List needs one key but multiple values

so at the end the Type of the input might be such as multiPanel but when we add the values user has to create the keys and the array of string values. GH paths in other words keys might be set by the users

Hope this helps

arrayValue1 =[];
swarmObj= {};
swarmObj.type = "System.String";
swarmObj.data = `\"` + input.Text + `\"`;
arrayValue1.push(swarmObj)
repeat all arrayValues
val.InnerTree["{ 0; 1 }"] = arrayValue1;
val.InnerTree["{ 0; 2 }"] = arrayValue2;
val.InnerTree["{ 0; 3 }"] = arrayValue2;
val.Keys = ["{ 0; 1}", "{ 0; 2 }", "{ 0; 3 }"];
val.Values = [arrayValue1, arrayValue2, arrayValue3];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants