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

2.4 Release #688

Merged
merged 24 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f151d32
Made API keys hidden (password fields) in the query translator module
nielsdejong Oct 10, 2023
0caa78a
Added new report action type for tables: multiselect checkboxes (#664)
nielsdejong Oct 27, 2023
3a2cf4d
Fix handling external updates of parameter values in parameter select…
nielsdejong Oct 27, 2023
5e27a02
Feature/new dashboard load UI (#657)
nielsdejong Oct 27, 2023
f4c2791
Bump @babel/traverse from 7.21.4 to 7.23.2 in /gallery (#670)
dependabot[bot] Nov 3, 2023
7b7bed1
Bump @babel/traverse from 7.20.13 to 7.23.2 (#669)
dependabot[bot] Nov 3, 2023
4f29427
Bump postcss from 8.4.23 to 8.4.31 in /gallery (#656)
dependabot[bot] Nov 6, 2023
f823de2
Bump postcss from 8.4.21 to 8.4.31 (#655)
dependabot[bot] Nov 6, 2023
e4b0ecd
Text hard to read on dark theme (#668)
JonanOribe Nov 6, 2023
96bd80b
Hotfix for wrong default parameter replacement in markdown
nielsdejong Nov 7, 2023
2d030a4
Merge branch 'develop' of github.com:neo4j-labs/neodash into develop
nielsdejong Nov 7, 2023
295857b
Add back arrow on connection modal (#675)
hugorplobo Nov 10, 2023
3742393
VULCAN-126/Override default message (#683)
nielsdejong Nov 10, 2023
be8b08f
Fix/hiding columns in table (#685)
AleSim94 Nov 13, 2023
ad4bd0b
Fix parameters values (#641)
BennuFire Nov 13, 2023
d7be8c7
Updated dashboard format to 2.4. Double resolution for horizontal and…
nielsdejong Nov 14, 2023
fceb5f3
Feature/gantt chart (#684)
alfredorubin96 Nov 14, 2023
c54acd3
adding in advanced config for the graph viz more graph layout config …
AleSim94 Nov 14, 2023
a6140d0
Adding form widget as a new extension (#568)
nielsdejong Nov 14, 2023
27d35f1
Model Examples and LLM improvements (#600)
alfredorubin96 Nov 15, 2023
85ff8fd
Merge branch 'master' into develop
nielsdejong Nov 16, 2023
9732c09
Added release notes for 2.4 + bonus feature (keyboard shortcut to run…
nielsdejong Nov 16, 2023
86cf207
Hotfixes for Sonarqube issues
nielsdejong Nov 16, 2023
85d9581
minor fix in the forms where it wasn't getting the correct value in t…
alfredorubin96 Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Feature/gantt chart (#684)
* Added forms skeleton

* Completed form skeleton

* WIP on forms interface

* Form framework (data entry, running, success, error) added

* Added comments

* Adding fields specification interface

* UI for specifying individual parameter in a form

* changing Dockerfile to enable args during build

* fixing typo on argument in dockerfile

* reverting dockerfile to older version

* Rendering parameters inside the form component

* Added docs for forms. Improved stability on form

* Fixed warnings in console

* Finished IT test for forms report

* Added package

* added new field to disable a parameter selector (in this way it works only with actions)

* Gantt Chart Visualization

* Fixed issue where parameter values were not updated on external changes

* Fixed styling on freetext spinner

* Workaround for clipping menu selectors in Needle

* fix(rule based styling): js doing is magic with parseFloat (some strings were casted to floats event if they were just strings starting with 0

* Added save button to form create UI

* removing console logs

* Fix for needle dropdowns not showing on modals

* Sortable list for form parameters

* Improving the drag 'n drop

* Iterating on form interface

* Final version of forms

* Disabling test

* Gantt chart with live data

* Improved robustness of form / parameter select component

* Improve Gantt chart customizability. Added report action for Gantt charts

* Added wait-logic for form submission, so that all fields are debounced and set correctly

* Added multiline support for freetext parameter selector

* Added support for drilled-down parameters used in the forms component

* Fixed issues with parameter selector/forms, improve usability

* Added default advanced settings to form

* hanging if orders to prevent wrong casting to number for certain edge cases (EX: string with numbers and E : 00E1304)

* adding more options to gantt chart and adding variable calendar type

* Prototype of Frappe Gantt implementation

* Improved version of frappe gantt

* work in progress on new gantt chart

* Clean up code structure

* Clean up and documenting Gantt chart

* Gantt chart stability & arrow directions

* Handling task dependency directions in Gantt chart

* Improved styling

* More optimization & style fixes.

* Added docs for Gantt Chart

* Added rule-based styling and actions to Gantt chart

* Finalized Gantt chart docs, examples, and fallback date parsing

* removing code smells

* trying to plug quarter date format and cleaning code

* cleaning code accordingly to SonarCloud

* Fixed UI not populating correctly for rule-based styling and actions

* Gantt - fixed default width/height for bars. Visible labels. Handling quarters

* Updated label positions

* Fixed inspect modal for Gantt chart, fixed arrow spacing between tasks

* Fixed linting issues

---------

Co-authored-by: Niels de Jong <niels-121@hotmail.com>
Co-authored-by: Alfred Rubin <alfredo.rubin@neo4j.com>
  • Loading branch information
3 people authored Nov 14, 2023
commit fceb5f30cd8aa820771eb77cb1aa6bf500c3985f
43 changes: 34 additions & 9 deletions cypress/e2e/start_page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
loadDashboardURL,
sankeyChartCypherQuery,
gaugeChartCypherQuery,
formCypherQuery,
} from '../fixtures/cypher_queries';

const WAITING_TIME = 20000;
Expand Down Expand Up @@ -244,13 +245,28 @@ describe('NeoDash E2E Tests', () => {
cy.get('main .react-grid-item:eq(2) .MuiCardContent-root h1', { timeout: 45000 }).should('have.text', 'Hello');
});

// it('creates a radar report', () => {
// // TODO - create a test for radar.
// })
it.skip('creates a form report', () => {
enableFormsExtension();
checkInitialState();
createReportOfType('Form', formCypherQuery, true, false);
cy.get('main .react-grid-item:eq(2) .form-add-parameter').click();
cy.wait(200);
cy.get('#autocomplete-label-type').type('Movie');
cy.get('#autocomplete-label-type-option-0').click();
cy.wait(200);
cy.get('#autocomplete-property').type('title');
cy.get('#autocomplete-property-option-0').click();

// it('creates a sankey report', () => {
// // TODO - create a test for sankey charts.
// })
cy.get('.ndl-dialog-close').click();

cy.get('main .react-grid-item:eq(2) button[aria-label="run"]').scrollIntoView().should('be.visible').click();
cy.wait(500);
cy.get('#autocomplete').type('The Matrix');
cy.get('#autocomplete-option-0').click();
cy.get('#form-submit').click();
cy.wait(500);
cy.get('.form-submitted-message').should('have.text', 'Form Submitted.Reset Form');
});

// Test load stress-test dashboard from file
// TODO - this test is flaky, especially in GitHub actions environment.
Expand Down Expand Up @@ -285,6 +301,14 @@ function enableAdvancedVisualizations() {
cy.wait(200);
}

function enableFormsExtension() {
cy.get('main button[aria-label="Extensions').should('be.visible').click();
cy.get('#checkbox-forms').scrollIntoView();
cy.get('#checkbox-forms').should('be.visible').click();
cy.get('.ndl-dialog-close').scrollIntoView().should('be.visible').click();
cy.wait(200);
}

function selectReportOfType(type) {
cy.get('main .react-grid-item button[aria-label="add report"]').should('be.visible').click();
cy.get('main .react-grid-item')
Expand All @@ -298,7 +322,7 @@ function selectReportOfType(type) {
cy.wait(100);
}

function createReportOfType(type, query, fast = false) {
function createReportOfType(type, query, fast = false, run = true) {
selectReportOfType(type);
if (fast) {
cy.get('main .react-grid-item:eq(2) .ReactCodeMirror').type(query, { delay: 1, parseSpecialCharSequences: false });
Expand All @@ -308,8 +332,9 @@ function createReportOfType(type, query, fast = false) {
cy.wait(400);

cy.get('main .react-grid-item:eq(2)').contains('Advanced settings').click();

cy.get('main .react-grid-item:eq(2) button[aria-label="run"]').click();
if (run) {
cy.get('main .react-grid-item:eq(2) button[aria-label="run"]').click();
}
}

function checkInitialState() {
Expand Down
1 change: 1 addition & 0 deletions cypress/fixtures/cypher_queries.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added docs/modules/ROOT/images/createform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/formbutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/forms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/formselector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/formsimple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/gantt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
*** xref:user-guide/reports/treemap.adoc[Treemap]
*** xref:user-guide/reports/radar.adoc[Radar Chart]
*** xref:user-guide/reports/sankey.adoc[Sankey Chart]
*** xref:user-guide/reports/gantt.adoc[Gantt Chart]
*** xref:user-guide/reports/map.adoc[Map]
*** xref:user-guide/reports/single-value.adoc[Single Value]
*** xref:user-guide/reports/gauge-chart.adoc[Gauge Chart]
*** xref:user-guide/reports/raw-json.adoc[Raw JSON]
*** xref:user-guide/reports/parameter-select.adoc[Parameter Select]
*** xref:user-guide/reports/form.adoc[Form]
*** xref:user-guide/reports/iframe.adoc[iFrame]
*** xref:user-guide/reports/markdown.adoc[Markdown]
** xref:user-guide/publishing.adoc[Publishing]
Expand All @@ -30,6 +32,7 @@
*** xref:user-guide/extensions/rule-based-styling.adoc[Rule-Based Styling]
*** xref:user-guide/extensions/report-actions.adoc[Report Actions]
*** xref:user-guide/extensions/natural-language-queries.adoc[Natural Language Queries]
*** xref:user-guide/extensions/forms.adoc[Forms]
** xref:user-guide/faq.adoc[FAQ]
* xref:developer-guide/index.adoc[Developer Guide]
** xref:developer-guide/build-and-run.adoc[Build & Run]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ The following visualizations are part of this extension:

- A link:../../reports/sankey[Sankey Chart] to visualize flows.
- Three charts to plot hierarchical data (link:../../reports/sunburst[Sunburst], link:../../reports/circle-packing[Circle Packing], link:../../reports/treemap[Treemap])
- A link:../../reports/gauge-chart[Gauge Chart] to show percentages
- A link:../../reports/gauge-chart[Gauge Chart] to show percentages.
- An link:../../reports/choropleth[Choropleth] to visualize numeric, country-data.
- An link:../../reports/areamap[Area Map] to show an interactive world map, annotated with numeric country / region values.
- A link:../../reports/gantt[Gantt] chart to visualize dependencies between tasks.
- A link:../../reports/radar[Radar Chart] to create a radial view of multiple categoric values.

image::advanced-visualizations.png[Advanced Visualizations]
13 changes: 13 additions & 0 deletions docs/modules/ROOT/pages/user-guide/extensions/forms.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
= Forms

The 'forms' extension lets you combine different parameter selectors to update / modify your graph data.
Update queries are predefined by the dashboard builder, and the user is limited to specifying the parameters for the query only.

See link:../../reports/form[Form] on how to create, configure, and use forms.

> Keep in mind that data-altering forms require your Neo4j user to have **write-access** to the graph. Make sure you give access to a select group of power-users only.




image::forms.png[Forms]
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/user-guide/extensions/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The currently available extensions in NeoDash are:
- link:rule-based-styling[Rule-based Styling]
- link:report-actions[Report Actions]
- link:natural-language-queries[Natural Language Queries]
- link:forms[Forms]

== Types of Extensions

Expand Down
73 changes: 73 additions & 0 deletions docs/modules/ROOT/pages/user-guide/reports/form.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
= Form

A form is a special type of report that lets users run predefined, parameterized queries.
A single form can consist of:

- Zero or more link:../parameter-select[parameter selectors].
- A button that triggers submitting the form.

When creating a form, you write the Cypher query that is called when the submit button is clicked.
This query can then use the parameters specified as input. The image below provides an example of a form. On the left, the settings used to define the form, on the right, the final form as visible to the user.

image::createform.png[Complex Form]


== Examples

=== Simple Button

A form without parameters is a button that runs a specified query.
One or more buttons can be used to perform simple operations in the graph.
Below is an example of a simple button form. On submitting, the following query is executed:

[source,cypher]
----
MERGE (c:Counter)
SET c.count = c.count+1
----

image::formbutton.png[Button Form]

=== A Parameter and a Button
To create a form with dynamic input, use both a parameter and a button.
Below is an example of a form that deletes nodes from the graph. On submit, the following query is executed:

[source,cypher]
----
MATCH (p:Person)
WHERE p.name = $neodash_person_name
DETACH DELETE p
----

image::formsimple.png[Simple Form]

=== Parameters Only

By hiding the submit button, a form can also be used as a space-efficient way to embed multiple parameter selectors.
Disable `Has Submit Button` in the report's advanced settings, and add two or more parameter selectors to the form.

image::formselector.png[Parameter-only Form]


== Advanced Settings

[width="100%",cols="19%,17%,26%,38%",options="header",]
|===
|Name |Type |Default Value |Description

|Form Button Text |text |Submit |Text displayed on the button that submits the form.

|Reset Button Text | text |Reset Form |Text displayed on the button that resets the form to data entry mode.

|Confirmation Message | multiline text |Form submitted. |Text displayed to the user after the form is submitted successfully.

|Has Submit Button |on/off |on | When enabled, lets the user submit the form with a button. Disabling turns the form into parameters-only mode.

|Has Reset Button |on/off |on |When enabled, lets the user reset the form to enter more data.

|Has Submit Message |on/off |on |When enabled, the user to a seperate screen after submitting the form. Else, always stay in data-entry mode.

|Report Description |markdown text | | When specified, adds another button the report header that opens a pop-up. This pop-up contains the rendered markdown from this setting.


|===
81 changes: 81 additions & 0 deletions docs/modules/ROOT/pages/user-guide/reports/gantt.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
= Gantt Chart

link:../../extensions/advanced-visualizations[label:Advanced&nbsp;Visualization[]]

A Gantt chart can be used to visualize tasks on a timeline, as well as their dependencies.
The NeoDash Gantt chart views your tasks are nodes in the graph, and your relationships are dependencies between them.

To use the Sankey chart, nodes must have at least three properties on them:

- A `startDate`
- An `endDate`
- A `title`

In addition, different types of task dependencies can be visualized. The dependency must be stored as a property on a relationship, and can be one of four values:

- `**SE**`: The dependency is from the **S**tart of the origin task, to the **E**nd of the next task.
- `**SS**`: The dependency is from the **S**tart of the origin task, to the **S**start of the next task.
- `**ES**`: The dependency is from the **E**nd of the origin task, to the **S**start of the next task.
- `**EE**`: The dependency is from the **E**nd of the origin task, to the **E**nd of the next task.

== Examples

=== Gantt Chart
Return nodes and relationships to be visualized in the chart.
It is mandatory to specify the three node properties (start date, end date and title) in the report's advanced settings.

[source,cypher]
----
MATCH (a:Activity)-[r:FOLLOWS]->(a2:Activity)
RETURN a, r, a2
----

image::gantt.png[Gantt Chart]


== Advanced Settings

[width="100%",cols="15%,2%,6%,77%",options="header",]
|===
|Name |Type |Default Value |Description

| Bar Color | string | '#a3a3ff' | Default color for the task bars (with no style rules applied.)

| Task Label Property | string | 'activityName' | Node property to display on the task bar.

| Task Start Date Property | string | 'startDate' | Node property to use as a start date for the task.

| Task End Date Property | string | 'endDate' | Node property to use as an end date for the task.

| Task Ordering Property | string | (auto) | Custom ordering of the tasks. Defaults to use the start date property.

| Dependency Type Property | string | 'rel_type' | The relationship property that stores the dependency type. Property values must be one of `['SS', 'SE', 'ES', 'EE']`

| View mode | string | 'auto' | Zoom level of the chart. one of `['auto', 'Half Day', 'Day', 'Week', 'Month', 'Year']`.

|Margin Left (px) |number |24 |The margin in pixels on the left side of
the visualization.

|Margin Right (px) |number |24 |The margin in pixels on the right side
of the visualization.

|Margin Top (px) |number |24 |The margin in pixels on the top side of
the visualization.

|Margin Bottom (px) |number |40 |The margin in pixels on the bottom side
of the visualization.

|Auto-run query |on/off |on |when activated automatically runs the query
when the report is displayed. When set to `off', the query is displayed
and will need to be executed manually.

|Report Description |markdown text | | When specified, adds another button the report header that opens a pop-up. This pop-up contains the rendered markdown from this setting.
|===


== Rule-Based Styling

Using the link:../#_rule_based_styling[Rule-Based Styling] menu, the
following style rules can be applied to the Gantt chart:

- The color of a task bar.
2 changes: 2 additions & 0 deletions docs/modules/ROOT/pages/user-guide/reports/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ pages:
- link:areamap[Area Map]
- link:single-value[Single Value]
- link:sankey[Sankey Chart]
- link:gantt[Gantt Chart]
- link:gauge[Gauge Chart]
- link:raw-json[Raw JSON]
- link:parameter-select[Parameter Select]
- link:form[Form]
- link:iframe[iFrame]
- link:markdown[Markdown]
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"d3-scale-chromatic": "^3.0.0",
"dayjs": "^1.11.7",
"dom-to-image": "^2.6.0",
"gantt-task-react": "^0.3.9",
"leaflet": "^1.7.1",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
Expand Down Expand Up @@ -117,6 +118,7 @@
"@typescript-eslint/parser": "^5.42.0",
"babel-loader": "^8.2.3",
"babel-plugin-istanbul": "^6.1.1",
"circular-dependency-plugin": "^5.2.2",
"css-loader": "^3.6.0",
"cypress": "^12.17.4",
"eslint": "^8.26.0",
Expand All @@ -136,7 +138,6 @@
"typescript": "^4.8.4",
"webpack": "^5.77.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.7.3",
"circular-dependency-plugin": "^5.2.2"
"webpack-dev-server": "^4.7.3"
}
}
12 changes: 11 additions & 1 deletion public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,14 @@
z-index: 99 !important;
position: absolute;
}
/* End workaround */

/* End workaround */

/* Workaround for cleaning the Gantt chart UI */
.gantt-wrapper > div > div:first-child > div:first-child > div:first-child > div> div:not(:first-child) {
display: none;
}
.gantt-wrapper > div > div > div > div> div> div> div:not(:first-child) {
display: none;
}
/* End Gantt chart workaround */
6 changes: 3 additions & 3 deletions src/card/settings/CardSettingsFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const update = (state, mutations) => Object.assign({}, state, mutations);

const NeoCardSettingsFooter = ({
type,
fields,
schema,
fields = [],
schema = [],
reportSettings,
reportSettingsOpen,
extensions,
extensions = {},
onToggleReportSettings,
onReportSettingUpdate,
}) => {
Expand Down
15 changes: 13 additions & 2 deletions src/card/view/CardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const NeoCardView = ({
// e.g. Change of query, type, some advanced settings...
const [selectorChange, setSelectorChange] = useState(false);

const getLocalParameters = (parse_string): any => {
const getLocalParameters = (parse_string, drilldown = true): any => {
if (!parse_string || !globalParameters) {
return {};
}
Expand All @@ -74,7 +74,18 @@ const NeoCardView = ({
const styleRules = settings.styleRules ? settings.styleRules : [];
const styleParams = extensionEnabled(extensions, 'styling') ? identifyStyleRuleParameters(styleRules) : [];

let localQueryVariables: string[] = [...styleParams];
// Similarly, if the forms extension is enabled, extract nested parameters used by parameter selectors inside the form.
const formFields = settings.formFields ? settings.formFields : [];
const formsParams =
drilldown && extensionEnabled(extensions, 'forms')
? formFields
.map((f) => {
return Object.keys(getLocalParameters(f.query, false));
})
.flat()
: [];

let localQueryVariables: string[] = [...styleParams, ...formsParams];
while ((match = re.exec(parse_string))) {
localQueryVariables.push(match[1]);
}
Expand Down
Loading
Loading