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

Add support for calculations #1

Open
rymohr opened this issue Mar 8, 2013 · 3 comments
Open

Add support for calculations #1

rymohr opened this issue Mar 8, 2013 · 3 comments

Comments

@rymohr
Copy link
Member

rymohr commented Mar 8, 2013

Need to be able to write something like this:

template = "{{followers/following}}"
context = {followers: 97, following: 14}

Handlebars.compile(template)(context) # => "6.9"
@jeffmohr
Copy link
Member

jeffmohr commented Mar 8, 2013

Sweet! What about things like degree (in-degree, out-degree, or plain degree). Special case for those or that actually lands in the metrics engine?

@rymohr
Copy link
Member Author

rymohr commented Mar 8, 2013

I think I'd prefer to keep metric specific logic out of the templating engine. If the metric is available on the entity it could be used just like any other attribute though.

Basic idea would be that any time metrics were updated it would cache the value on the entity itself.

Only concern is possible conflicts with other attributes (very likely that degree will be used to track college degree). One option is just to append "centrality" to all the metrics.

element.get('degreeCentrality')

Other option is to just namespace the metrics to differentiate them from the actual account attributes:

element.get('metric:degree')

Preferences?

@jeffmohr
Copy link
Member

I prefer the metric approach over adding centrality to it so we have a bit more flexibility about what people are calculating using metrics.

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

No branches or pull requests

2 participants