We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
it would be nice to have something similar allowed (syntax negotiable, etc.):
<table> <th>Initial Sales</th> <tbody data-f-foreach="r in region"> <tr data-f-foreach="p in product"> <td><%= r %></td><td><%= p %></td><td><%= Initial Sales[r,p] %></td> </tr> </tbody> </table>
for the case where /v2/model/introspect for this model returns
"ranges": [ { "indices": [ "apple", "orange", "banana" ], "name": "product", "saved": false, "type": "Subscript Range" }, { "indices": [ "east", "west" ], "name": "region", "saved": false, "type": "Subscript Range" } ], "variables": [ { "name": "Initial Sales", "saved": false, "subscripts": [ "region", "product" ], "type": "Auxiliary" }, ]
(currently, this only works if region and product are separately model variables)
region
product
The text was updated successfully, but these errors were encountered:
@mmrj Haven't tried this, but shouldn't you be able to use the region[*] syntax here to loop through?
region[*]
Sorry, something went wrong.
sample testing code, which doesn't work:
<table> <th>Initial Sales</th> <tbody data-f-foreach="(region, rvalue) in Initial Sales[*,*]"> <tr data-f-foreach="(product, pvalue) in Initial Sales[<%= region %>,*]"><td> rvalue: <%= rvalue %>, pvalue: <%= pvalue %>, region: <%= region %>, product: <%= product %></td></tr> </tbody> </table>
for reference,
GET https://api.forio.com/v2/run/mj-unittest/vensim_arrays/0000015af132af5966650d159232430b7524/variables/?include=Initial%20Sales[east,*]
returns
{"Initial Sales[east,*]":{"east":{"banana":[1050],"apple":[1000],"orange":[1100]}}}
however,
GET https://api.forio.com/v2/run/mj-unittest/vensim_arrays/0000015af132af5966650d159232430b7524/variables/Initial%20Sales[east,*]
{ "east": { "banana": [ 1050 ], "apple": [ 1000 ], "orange": [ 1100 ] } }
@narenranjit this matches what i expect from the Run API in both cases; but the data-f-foreach seems to be expecting the second one ?
data-f-foreach
narenranjit
No branches or pull requests
it would be nice to have something similar allowed (syntax negotiable, etc.):
for the case where /v2/model/introspect for this model returns
(currently, this only works if
region
andproduct
are separately model variables)The text was updated successfully, but these errors were encountered: