Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
3c9567f
Update Flowchart-Designer.md
timurbazhirov Dec 22, 2022
6a71804
Update Materials-Designer.md
timurbazhirov Feb 11, 2023
96e01f3
fix: file name in URL
timurbazhirov Feb 11, 2023
680de48
feat: Initial commit
Apr 8, 2023
7dc00a1
feat: page layout added
Apr 8, 2023
d64e18a
feat: drag and drop custom nodes onto flowchart
Apr 8, 2023
e675d26
feat(styles): styling framework for custom nodes
Apr 8, 2023
73dd139
feat(styling): styling structure changes
Apr 8, 2023
1932871
feat: nodes state and input-output nodes
Apr 8, 2023
01f0843
fix: correct minor syntax issue
Apr 8, 2023
2d6282a
feat: OperationNode
Apr 8, 2023
1349404
feat: handled drawing edge connections
Apr 8, 2023
6672832
feat: font changed and css modularized
Apr 8, 2023
8933b4c
feat: calculation handled
Apr 8, 2023
4eebcc2
feat: state updated on user input
Apr 8, 2023
ab49249
feat: binary comparison node
Apr 8, 2023
f9c8b29
feat(style): modularized handle css
Apr 8, 2023
4d34027
fix: operand order honored correctly
Apr 8, 2023
53a04c9
fix: input handles now only support one edge
Apr 8, 2023
81f1512
chore(docs): README.md created
Apr 8, 2023
bef14ce
feat: JSONViewer functional
Apr 8, 2023
011b279
feat: resizable split panes
Apr 8, 2023
ce911c6
feat(style): added more UI for node selection
Apr 8, 2023
7c0c9d3
chore: moved nodes to new customNodes folder
Apr 8, 2023
18ef310
feat: toggleable darkmode added
Apr 8, 2023
0fdb7db
chore(docs): user stories updated
Apr 8, 2023
2b3bf03
feat: support for unary operations added
Apr 8, 2023
e9e6b91
feat: exponentiation added
Apr 8, 2023
f68ffa9
feat: color of nodes on minimap now match actuals
Apr 8, 2023
eb0e2d9
fix(style): minimap colors added
Apr 9, 2023
b5491c6
chore: user stories updated
Apr 9, 2023
035c1ec
chore: prettier formatting applied to entire repo
Apr 9, 2023
2fa33fa
chore(docs): user stories updated
Apr 9, 2023
a97b5f0
chore: nodeTypes moved to seperate file
Apr 9, 2023
67941ba
feat(style): can drag from entire button area and other style changes
Apr 9, 2023
b884e92
feat: nanoid for node ids and start node added
Apr 9, 2023
da840fd
fix(style): init instructions restyled
Apr 9, 2023
fb0cda2
refactor: drag and drop button modularized
Apr 10, 2023
66e732a
refactor: node creation modularized
Apr 10, 2023
963777e
chore(docs): user stories updated
Apr 10, 2023
3c8b77f
refactor: reorganize dir and renamed components
Apr 10, 2023
55f5da7
refactor: update outputs moved to hook and cleanup
Apr 10, 2023
9a491a7
chore: formatting and moved op labels to new file
Apr 10, 2023
1f5ce01
refactor: renaming file and variable
Apr 10, 2023
b59a3e8
feat: syntax highlighting
Apr 10, 2023
a607bdf
chore(docs): user stories updated
Apr 10, 2023
ceebca5
feat(style): removed attribution and unnecessary styling
Apr 10, 2023
dc9e412
feat: project merged into meteor framework
Apr 10, 2023
b550853
feat: framework for saving flows added
Apr 10, 2023
0377522
fix: instruction typo corrections
Apr 10, 2023
6589e7b
feat: support for loading saved flows added
Apr 10, 2023
924103e
fix: input node loads default value from flow
Apr 10, 2023
3384eb8
feat: added support for flow names
Apr 10, 2023
297bda1
feat: support for clearing flows from db
Apr 10, 2023
4fe589e
fix: flow names now enforced as unique
Apr 10, 2023
734da97
feat(style): styling added to new UI elements
Apr 11, 2023
db8f5ca
chore(docs): user stories updated
Apr 11, 2023
db338de
fix: op node values now displayed correctly on load
Apr 11, 2023
0a772e1
refactor: function definitions now in one location
Apr 11, 2023
563baff
feat: clear button implemented
Apr 11, 2023
a4eb247
refactor: revert location of reactFlowInstance
Apr 11, 2023
8563f0e
chore(docs): doc renamed to README.md
Apr 11, 2023
0d3a648
refactor: most functionality moved to custom hooks
Apr 13, 2023
8ec726d
refactor: formatting applied to entire project
Apr 13, 2023
437ce41
fix: duplicate keys for edges prevented
Apr 14, 2023
b4af948
fix: nodes/edges state passed to hook properly
Apr 14, 2023
2484dc4
feat: allow overwriting flow of same name
Apr 14, 2023
8da316a
feat: jest testing framework added
Apr 14, 2023
7bc781b
fix: auto-fit view on load
Apr 15, 2023
78f1fd8
feat: overwrite flow now supported in client
Apr 15, 2023
f677e09
fix: bundle optimization of highlight.js
Apr 15, 2023
dca0fd6
fix: code language defined explicity
Apr 15, 2023
8a137c8
feat: cypress e2e testing framework added
Apr 15, 2023
20e9db8
test: cypress e2e tests implemented
Apr 16, 2023
01dfd25
feat(test): all basic test cases added
Apr 16, 2023
a072ba8
chore(docs): user stories updated
Apr 16, 2023
0ce0de4
chore(docs): README updated
Apr 16, 2023
5bad818
fix: including package.json for scripts
Apr 16, 2023
0cb1341
feat(test): complex flowchart (tanh) test added
Apr 16, 2023
aea8bb6
chore(docs): README updated
Apr 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
8 changes: 7 additions & 1 deletion Flowchart-Designer.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ We leave exact timing to the candidate. Must fit Within 5 days total.

# Examples

To view examples or discuss this task more in details, please [contact us](README.md).
We recommend reviewing the following:

- Introduction to Flowcharts: https://www.geeksforgeeks.org/an-introduction-to-flowcharts/
- An example convergence workflow: https://docs.mat3ra.com/models/auxiliary-concepts/reciprocal-space/convergence/
- ReactFlow library examples: https://reactflow.dev/docs/examples/overview/ and https://pro.reactflow.dev/pro-examples

To discuss this task more in details, please [contact us](README.md).
4 changes: 2 additions & 2 deletions Materials-Designer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

# Overview

Create a skeleton IDE (integrated development environment) for materials design. Close to Adobe Dreamweaver (or any other IDE) - when you can change html-markup and simultaneously see the result in another tab. We edit material in XYZ format and view result in 3D.
Create a skeleton IDE (integrated development environment) for materials design, where one can change text and simultaneously see the visual result in another tab. We edit material in XYZ format and view result in 3D.

Front-end developers: use Meteor and React.js and minimalistic UX/UI.
Front-end developers: use React.js and minimalistic UX/UI.

Pure UI/UX designers: create high fidelity mockups. 

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Each file represents an assignment similar to what one would get when hired.
| Front-End / UX | [Materials Designer](Materials-Designer.md) | ReactJS / UX Design, ThreeJS |
| Front-End / UX | [Flowchart Designer](Flowchart-Designer.md) | ReactJS / UX Design, DAG |
| Back-End / Ops | [Parallel Uploader](Parallel-File-Uploader.md) | Python, OOD, Threading, Objectstore |
| CI/CD, DevOps | [End-to-End Tests](End-To-End-Tests.md) | BDD tests, CI/CD workflows, Cypress |
| CI/CD, DevOps | [End-to-End Tests](End-to-End-Tests.md) | BDD tests, CI/CD workflows, Cypress |
| HPC, Cloud Inf | [Cloud HPC Bench.](Cloud-Infrastructure.md) | HPC Cluster, Linpack, Benchmarks |
| HPC, Containers| [Containerized HPC](Containerization-HPC.md) | HPC Cluster, Containers, Benchmarks |

Expand Down
109 changes: 109 additions & 0 deletions seankwarren/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Flowchart Calculator

Flowchart Calculator is a Meteor/React application that allows users to create flowcharts representing mathematical operations, functions, and logical comparisons. It's built using React, Meteor, and MongoDB and the React Flow library.

## Features

- Drag and drop interface for adding nodes to the flowchart
- Live calculation and display of results
- Support for arithmetic operations (+, -, *, /, ^), functions (sin, cos, tan, exp), and logical comparisons (>, <, >=, <=, ==, !=)
- View real-time syntax-highlighted JSON representation of nodes and edges
- Interactive flowchart editor powered by React Flow
- Support for saving and loading flowcharts
- Dark mode 🎉

## Usage

- Drag and drop a custom node (input, operation, comparison, or output) from the buttons panel onto the flowchart area.
- Connect nodes using the handles on each node. Ensure to connect the output handle of one node to the input handle of another.
- Edit input nodes or operation/comparison nodes to see the updated output values in the output nodes.
- View the JSON representation of nodes and edges in the right pane.
- Name and save flowcharts and reload them

## Setup

Install dependencies using `npm install`.

Run the development server using `meteor`.
> will launch on <a href="http://localhost:3000/">localhost:3000/</a>

Run tests with `npm run cypress:open`


## Front-end Environment Structure:
imports
├── api
│ └── flows.js // Defines collection on MongoDB
└── ui
├── App.jsx // Root component for React
├── components // All React components
│ ├── customNodes // Custom node types for React Flow
│ │ ├── BinaryNode.jsx
│ │ ├── ComparisonNode.jsx
│ │ ├── InputNode.jsx
│ │ ├── OutputNode.jsx
│ │ ├── UnaryNode.jsx
│ │ ├── index.js // Allows for destructured import
│ │ └── nodeTypes.jsx // Defines node types for React Flow
│ ├── mainPage // Main page elements
│ │ ├── FlowchartCalculator.jsx // Main component containing the app's state
│ │ ├── FlowchartCanvas.jsx // Contains the React Flow component
│ │ ├── JSONViewer.jsx // Contains the JSON panel
│ │ └── NodeButtons.jsx // Contains the drag and drop node buttons
│ └── reusable // Generic components that can be reused anywhere
│ ├── DarkModeContext.jsx
│ ├── DarkModeSwitch.jsx
│ ├── DraggableButton.jsx
│ └── ResizablePane.jsx
├── hooks // Hooks for maintaining state
│ ├── useDraggable.jsx // Handles Drag & Drop functionality
│ ├── useInputField.jsx // Handles InputField state change
│ ├── useLocalFlowData.jsx // Handles all state for React Flow
│ ├── usePrevious.jsx // Stores previous value of a state
│ ├── useRemoteFlowData.jsx // Handles interaction with flows on DB
│ ├── useResizeable.jsx // Stores state for SplitPane
│ ├── useToggleable.jsx // Handles state change for any toggleable state
│ └── useUpdateOutputNodes.jsx // Contains logic for updating outputs on state change
├── styles
│ ├── a11y_light.css // Syntax highlighting styling
│ └── index.css // Main page styling
└── utils
├── calculate.js // Recursive calculation function
├── createNode.js // Node creation logic
├── getNodeColor.js // Access node colors
├── operationDef.js // Defines operations for the different node type
├── performOperation.js // Performs a single operation
└── startingNode.js // Contains the starting instructions node






## Complete User Stories:
- [x] As an end user, I should be able to perform calculations using these 4 binary operators (+, -, *, /) and 6 comparison operators (<, >, >=, <=, ==, !=).
- [x] As an end user, when I operate on two values, I should be able to read the output as a number in an output node.
- [x] As an end user, when I compare two values, I should be able to read the output as 'true' or 'false' in an output node.
- [x] As an end user, when I operate on or compare two values, the top-most edge should always come first in the operation. e.g $3\over4$ vs $4\over3$
- [x] As an end user, when I add any nodes or edges, the results in all output nodes should update.
- [x] As an end user, the result should update on any change to the input values or selected operators that I make.
- [x] As an end user, I should be able to construct flowcharts of arbitrary depth and number of output cells.
- [x] As an end user, I should be able to drag desired nodes onto the flowchart, and they should be placed at the dropped position.
- [x] As an end user, I should be able to edit the flowchart and have the JSON update accordingly.
- [x] As an end user, I should be able to use common unary operators such as sin, cos, tan, and e<sup>x</sup>.
- [x] As an end user, I should be able to use the y<sup>x</sup> binary operator, that takes two inputs and calculates the exponential.
- [x] As an end user, node types should be quickly and easily distinguished by shape and color.
- [x] As an end user, I should see some nodes on screen when I launch the application that explain how to use the app.
- [x] As an end user, I should be able to easily read the JSON representation with syntax highlighting.
- [x] As an end user, I should be able to click a 'Save Flow' button to save the JSON datastructure to a MongoDB instance.
- [x] As an end user, I should be able to select a saved flow from a dropdown list and load it in the flowchart and JSON viewers.
- [x] As an end user, I should be able to click on a button called 'clear' to clear the flowchart.
- [x] As a development user, I should be able to automatically test all of the binary, unary, and comparison operations using cypress.
- [x] As a development user, I should be able to automatically test all basic user interactions, including toggling darkmode, __resizing the pane__, clearing the flowchart, dragging and dropping nodes, and drawing edges using cypress.
- [x] As a development user, I should be able to automatically test the save and load procedure using cypress.
- [x] As a development user, I should be able to automatically test a complex flowchart like the tanh() function using cypress.

### TODO User Stories:
- [ ] As a development user, I should be able to automatically test that the rendered JSON is updated on change, and accurate using cypress.
- [ ] As a development user, I should be able to unit test each react component and hook using jest.
7 changes: 7 additions & 0 deletions seankwarren/flowchart-calculator/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}

19 changes: 19 additions & 0 deletions seankwarren/flowchart-calculator/.meteor/.finished-upgraders
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file contains information which helps Meteor properly upgrade your
# app when you run 'meteor update'. You should check it into version control
# with your project.

notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package
1.4.3-split-account-service-packages
1.5-add-dynamic-import-package
1.7-split-underscore-from-meteor-base
1.8.3-split-jquery-from-blaze
7 changes: 7 additions & 0 deletions seankwarren/flowchart-calculator/.meteor/.id
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file contains a token that is unique to your project.
# Check it into your repository along with the rest of this directory.
# It can be used for purposes such as:
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics

rcv4oc4b8z25.ahdsmkkw6g4
22 changes: 22 additions & 0 deletions seankwarren/flowchart-calculator/.meteor/packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base@1.5.1 # Packages every Meteor app needs to have
mobile-experience@1.1.0 # Packages for a great mobile UX
mongo@1.16.5 # The database Meteor supports right now
reactive-var@1.0.12 # Reactive variable for tracker

standard-minifier-css@1.9.0 # CSS minifier run for production mode
standard-minifier-js@2.8.1 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
ecmascript@0.16.6 # Enable ECMAScript2015+ syntax in app code
typescript@4.9.4 # Enable TypeScript syntax in .ts and .tsx modules
shell-server@0.5.0 # Server-side component of the `meteor shell` command
hot-module-replacement@0.5.2 # Update client in development without reloading the page


static-html # Define static page content in .html files
react-meteor-data # React higher-order component for reactively tracking Meteor data
2 changes: 2 additions & 0 deletions seankwarren/flowchart-calculator/.meteor/platforms
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
server
browser
1 change: 1 addition & 0 deletions seankwarren/flowchart-calculator/.meteor/release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
METEOR@2.11.0
71 changes: 71 additions & 0 deletions seankwarren/flowchart-calculator/.meteor/versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
allow-deny@1.1.1
autoupdate@1.8.0
babel-compiler@7.10.3
babel-runtime@1.5.1
base64@1.0.12
binary-heap@1.0.11
blaze-tools@1.1.3
boilerplate-generator@1.7.1
caching-compiler@1.2.2
caching-html-compiler@1.2.1
callback-hook@1.5.0
check@1.3.2
ddp@1.4.1
ddp-client@2.6.1
ddp-common@1.4.0
ddp-server@2.6.0
diff-sequence@1.1.2
dynamic-import@0.7.2
ecmascript@0.16.6
ecmascript-runtime@0.8.0
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.3
es5-shim@4.8.0
fetch@0.1.3
geojson-utils@1.0.11
hot-code-push@1.0.4
hot-module-replacement@0.5.2
html-tools@1.1.3
htmljs@1.1.1
id-map@1.1.1
inter-process-messaging@0.1.1
launch-screen@1.3.0
logging@1.3.2
meteor@1.11.1
meteor-base@1.5.1
minifier-css@1.6.2
minifier-js@2.7.5
minimongo@1.9.2
mobile-experience@1.1.0
mobile-status-bar@1.1.0
modern-browsers@0.1.9
modules@0.19.0
modules-runtime@0.13.1
modules-runtime-hot@0.14.1
mongo@1.16.5
mongo-decimal@0.1.3
mongo-dev-server@1.1.0
mongo-id@1.0.8
npm-mongo@4.14.0
ordered-dict@1.1.0
promise@0.12.2
random@1.2.1
react-fast-refresh@0.2.6
react-meteor-data@2.7.1
reactive-var@1.0.12
reload@1.3.1
retry@1.1.0
routepolicy@1.1.1
shell-server@0.5.0
socket-stream-client@0.5.0
spacebars-compiler@1.3.1
standard-minifier-css@1.9.0
standard-minifier-js@2.8.1
static-html@1.3.2
templating-tools@1.2.2
tracker@1.3.1
typescript@4.9.4
underscore@1.0.12
webapp@1.13.4
webapp-hashing@1.1.1
10 changes: 10 additions & 0 deletions seankwarren/flowchart-calculator/__mocks__/meteor/meteor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Meteor = {
isClient: true,
isServer: false,
methods: () => {},
call: jest.fn(),
startup: jest.fn(),
subscribe: jest.fn(),
};

export default Meteor
1 change: 1 addition & 0 deletions seankwarren/flowchart-calculator/client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './main.jsx';
8 changes: 8 additions & 0 deletions seankwarren/flowchart-calculator/client/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Flowchart Calculator</title>
</head>
<body>
<div id="app"></div>
</body>
14 changes: 14 additions & 0 deletions seankwarren/flowchart-calculator/client/main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Meteor } from 'meteor/meteor';
import App from '/imports/ui/App';

Meteor.startup(() => {
const container = document.getElementById('app');
const root = createRoot(container);
root.render(<App />);

// Dispatch the 'meteor-app-loaded' event
const event = new Event('meteor-app-loaded');
window.dispatchEvent(event);
});
10 changes: 10 additions & 0 deletions seankwarren/flowchart-calculator/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: 'http://localhost:3000',
},
});
Loading