Altinn / Altinn/app-frontend-react
Writing formulas with integrated dynamic values
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description
There is no way of writing a proper formula in html/markdown without using Javascript (as far as i know). I tried to present a fraction like this we had in AltinnII.

but ended up using this, which has poorer readability.

In these pictures the number 99 % has been calculated in C#, so it should be possible to integrate values from the datamodel and if possible text from the resource-files.
I found something that looks useful on this web-page: https://www.sqlpac.com/en/documents/html-equations-math-with-mathjax-asciimath.html but I don't know how to f.ex. use this to make a custom "formula-component" or something like that.
### Additional Information
With this implemented it would also be possible to write far more advanced expressions, like this f.ex.

Not that I need to right now, but I guess there are other people that also have a need to explain how things are calculated, maybe Skatteetaten?
Contributor guide
Research direction
No source file, test, or entry point is identified. Start by reviewing the frontend's existing HTML/Markdown rendering and the proposed MathJax approach, then define how formulas receive datamodel and resource values. Done should mean authors can render readable formulas with integrated dynamic values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100