nfdi4plants / swate Goto Github PK
View Code? Open in Web Editor NEWExcel Add-In for annotation of experimental data and computational workflows.
Home Page: https://swate-alpha.nfdi4plants.org
License: MIT License
Excel Add-In for annotation of experimental data and computational workflows.
Home Page: https://swate-alpha.nfdi4plants.org
License: MIT License
It is possible to set metadata of cells via office.js. Especially for users that create templates for others to use, information on the proposed cell contents is helpful. This would be set via a JSON string in the XML tag with the key "validationParams" and should have the following fields:
importance - an integer between 0 and 100
content type - one of : ontologyTerm, text, number, int, decimal, url, boolean
if the content type is ontologyTerm, asdd the isA restriction if set: term[restriction]
Create a JSON schema for this
Create a form to generate this for a column
Edit: Office.js only supports custom tags, not custom attributes on existing tags. Therefore, we need to investigate alternative places to save this information. For now we can add the validation table to the app model and later use that data to generate the file/tags/etc we need.
Edit2(by @Freymaurer): As of the latest decision all swate validation data will now be saved in the excel custom xml, as desribed here.
The AddIn needs a basic autocomplete search on term names:
Currently the responsive design is regulated by using the following scheme for switching between designs.
let mediaQuery = window.matchMedia("(min-width:575px)")
if mediaQuery.matches then
str (pageLink |> Routing.Page.toString)
else
pageLink |> Routing.Page.toIcon
This should be done via
@media only screen and (max-width: XXXpx) {
previousClass: {
style
}
}
Describe the bug
If advanced search finds enough results to show them on one page, page number is shown twice.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Only 1 page number (or none) should be displayed.
OS and framework information (please complete the following information):
Both the API and the client application should contain version info. I imagine it like this:
/IAnnotatorAPI/v1/YOUR/ROUTE/HERE
0.1-beta
atm), and this should be populated via a call to the backend.One could auto generate the manifest.xml file from an abstraction layer generated on the F# side. This would make adding pages that must correspond to ribbon buttons / context menu buttons easier.
When using the excel autofill features, the fill should expand to the annotation reference columns (e.g. TERM SOURCE REF)
Necessary features:
Edit: As of ..
Your approach filling only the selected range seems better to me.
This seems like an extra step that will not be used regulary. As we currently allow users to remove unwated file names it is not necessary to select those you want to insert.
Are files taken by the order they are selected, or by the ordering of the explorer (e.g. alphabetical)? If the latter is true, at least reordering of the filelist must be possible if you are against selections. But you are right, we can take a minimal approach at all of this, as reordering can also be done via excel ui
Clicking the taskpane button initializes the addin with an initial model. When changing the page (by clicking any navigation tab) the first time, a new initialization is triggered. This should not happen, and could be either due to the addin not using a common runtime or the taskpane buttons not pointing on the root page.
Columns and their term source references and/or associated other columns (such as units) have to be grouped or at least created as groups when inserting them.
Current plan:
While current abstractions should work well for study and assay parts of the ISA model, the investigation part which contains metadata about authors, publications etc. associated with the study is not supported currently. Using excel for that seems impractical though, a better alternative may be a full screen form modal inside of excel triggered by the web app, which then from the input generates a new tab and/or file containing this metadata.
This issue is related to the pull request #32 .
The following list of points is copied from the pull request:
Update to only dotnetcore3.1 projects
simplify paket groups
[BUGFIX] Error with Fable solved by setting the version for Fable.SimpleJson to 3.11.0
Migrate database from MSSQL to MySql
-> Add docker-compose.yml file for MySql+Adminer instance
-> Add db.sql dump file to initialize Swate DB to MySql docker instance
-> Adjust fake.fsx to automatically start docker-compose with "OfficeDebug" target
Update README with information about docker.
In addition i though about automaticall adding the LocalConnectionString to the user secrets, but was unsure if this is wanted.
If you found room for improvement or want something changed, just tell me.
The addin functionality is exposed via hash based urls for different functionality e.g. /#TermSearch for the termSearch component. All Endpoints need a respective UI element in Excel.
This would be much simpler when considering #8
Currently, units are only saved in the cell format of the respective column. To make this more ISA conform, the annotation of a column with a unit requires the Unit
column to spawn, with associated Term source columns
analogously to the term search component, but limited to unit ontology entries in the database.
Add a file picker react component to frontend that can be used to get file names (which later will be inserted into excel cells)
While it is now possible to use multiple annotation tables across sheets, The warning about a missing table is only displayed once, before creating the first table.
The Database API does not have to be in the same project as the addin. For easier maintenance it could be beneficial to move it to a separate repo in the future.
As it is, we cannot add a column with the name of an already existing column. To circumvent this we need a unique identifier.
I first thought of actual Guids but the result bloated the column width too much to allow for effortless working on the table.
Example:
Parameter [instrument model; #75e44bc6-f5b3-4bbc-874b-1fd76a78129f]
So i went with the approach to test the column headers for the new-would-be-name and if it exists i go one up for the id.
Example:
The logic behind this creates a name with id 0 (will not be shown) and if it finds this name in the table it will loop over the name creation with (previousId+1). To circumvent any problems with the hidden column names, it also checks for those.
testOntologyInsert
and getTermsForAdvancedSearch
do not show their examples in the api docs.
This application will do better when run as multipage application. It is then possible to expose different functionality for different ribbon and/or context menu items inside Excel. Things that need to be done:
take heavy inspiration from here : https://stackoverflow.com/questions/54970180/how-can-i-do-a-simple-elmish-router
Describe the bug
If search text field is active, the textcursor is always set to the end of the text if a letter is added.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Textcursor stays at the expected position (1 character further than before)
OS and framework information (please complete the following information):
Besides suggestion based quick search, the addin also needs the option for advanced search on Terms:
How to reproduce:
When this project matured, one should create a project template to make this easier for anyone that may follow. I had a lot of roadblocks that could be prevented by such a template, so let this issue serve as a reminder that it should be done eventually.
This issue is related to the PR #34. The following notes are copies form the PR.
Features added:
- Add is_a directed search functionality to term search.
- Restored bulma imports in style sheets for bulma-extensions switch and tooltip.
- change addBuildingBlock function to add 3 columns with two cols hidden. These extra columns will hold additional ontology term info in the future
- add new sql dump with is_a directed search procedure and is_a relationships in TermRelationship table
Do not merge until:
- is_a directed search returns all children and not only direct children of is_a relationships.
- insert term function also inserts the additional info in the new extra columns of addBuildingBlock.
As mentioned above there are still major features of this PR missing, so do not merge it yet.
Move advanced search from term search only to a modal that can be opened on any simple search.
Formatting rules can be generated based on the annotation building block type and optional unit after inserting the column into the annotation table
Validate Data in office.js:
https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-data-validation
Cell formatting:
https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-ranges#set-range-format
Validation and formatting seems to work on a per-cell basis, and can be set in bulk for ranges. therefore, it would be best to create formatting/validation properties of the ranges that are inserted as building blocks
This tab should contain:
Feature documentation should be linked via the info tab (see #46) and describe the functionality that is done in the frontend, e.g. the annotation functionality and term search. It is up for discussion whether to host this on gh-pages, the application itself, or use a wiki for that. API docs can be auto generated but must be populated via examples.
Api documentation
Feature documentation
Color coding the columns (for example header fill) could make it possible to get rid of type prefixes (e.g. Parameter [x] -> x). This must be visual only, dont omit prefixes on export
Describe the bug
If one selects one or several rows when creating the annotation table, the application fails.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Since creating a table into column eternity (1 048 576 columns) may not be a viable option, it would be good to have a fixed limit for this (e.g. 100 rows).
OS and framework information (please complete the following information):
Additional context
This error seems to occur much more often if the system is under stress.
Now that we host a stable beta version of swate, we can think about making the usage easier by publishing it to the microsoft add-in appsource. The steps are outlined here:
https://docs.microsoft.com/de-de/office/dev/store/submit-to-appsource-via-partner-center
Column headers that define the value via an ontology term should have their input optionally restricted to children/is-a relationships pointing to that term.
Example: creating the following parameter header : Parameter[MassSpectrometerInstrument(i made this term up)]
should only allow valid mass spectrometers (meaning is-a relationships in that ontology).
While working on the next few issues i noticed a growing need to work with the column headers in a more efficient way. After you (@kMutagene ) sent me this quote regarding fable and regex:
Regex will always behave as if passed RegexOptions.ECMAScript flag (e.g., no negative look-behind or named groups)
I gave it another try and found a working pattern, which will be implemented in the next commit on my feauture branch.
How properties of the current excel theme can be accessed:
https://docs.microsoft.com/en-us/javascript/api/office/office.officetheme?view=word-js-preview
Describe the bug
If using advanced search in TermSearch and selecting an ontology, it can not be switched back to 'select ontology', thus it is not possible to search for all ontologies without cancelling and restarting the advanced search again.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
'select ontology' should reappear again.
Screenshots
'select ontology' field before selecting an ontology.
No 'select ontology' anymore after an ontology was selected.
OS and framework information (please complete the following information):
Socials:
- DataPLANT twitter
Currently our api docs will not show the example for advanced term search. My tests showed that this happens with apis that have 5 or more parameters. I already opened an issue about this.
Excel does not track an undo stack for operations done by addins, therefore it is beneficial if the user does not screw his complete sheet up when they make a mistake.
Many functions in the Office.js API need a minimum version of Excel. when using more recent APIs, it is necessary to catch the case where the user has an old excel version so that the function call doesn't fail. An example can be seen here, where the auto-resize of columns is API set specific.
Describe the bug
If one annotation table is created, it is not possible to create another one in another worksheet.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Create annotation table button should appear when switching to a worksheet without an annotation table.
Screenshots
New excel file without annotation table. It is possible to add a new one.
Not able to add another annotation table, even after reloading the Add-In.
OS and framework information:
Additional context
2 things to notice:
Is your feature request related to a problem? Please describe.
While working on Issue #48 a rising need to have an option to fill all hidden columns with the correct input. An average user would paste a term into a column (together with the info for the hidden cols) or even paste it into multiple rows at once. But if he then extends the rows and copy pastes the info in the new rows, the hidden cols would be empty.
Describe the solution you'd like
For now we should just implement a button to fill empty cells in hidden cols.
Describe alternatives you've considered
Optimally this would happen onChange. But currently we don't know how to allow excel to dispatch app messages.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.