editor-core
The core repository for Data-Forge Notebook's editor. Reused in the Electron and Online builds.
Data-Forge Notebook is being open sourced in this code repository in 2022.
Read more about the decision here
See the issues page to contribute to the discussion
Follow the developer on Twitter for more frequent news and updates
Setup
Clone this repo locally, open a terminal and change to the local directory.
Install dependencies:
npm install
Run the browser shell
This runs the whole notebook editor in the browser.
npm start
Run the Electron shell
This runs the whole notebook editor in Electron (with a static build):
npm run electron
To run in Electron with live reload:
npm run electron:live
Run the testbed
The testbed is used for testing selected UI components.
npm run testbed
Run Storybook
Storybox showcases various configurations for UI components.
npm run storybook
Build the TypeScript code
npm run build
Compiled JavaScript code is output to ts-build
.
Run automated test
npm tests
Test a local plugin
Clone a plugin repo, for example the structured data plugin.
Install dependencies (npm install
) and then run the web server for the local plugin (usually npm start
or npm run start:dev
).
Open editor-core/src/testbed/services/plugin-repository.ts
and set pluginUrl
to the local URL for the plugin web server (e.g. http://127.0.0.1:5000).
Dark mode
###################################################### Ashley Davis and I are moving our conversation from email to this issue concerning the implementation of Dark-Light Mode Styling with DataForge Notebook (DFN) The below email is from Ash to Me for contextual purposes (see below) ###################################################### (Email from Ash to me...)
I thought of something you might like to help with on DFN.
I'd love to get darkmode working.
Simple part will be to enable dark theme on Blueprintjs.
The harder part will be to make all the plugins (which don't use Blueprintjs) look nice in dark mode.
You can learn about Blueprint js here: https://blueprintjs.com/
If you are interested, open an issue on the DFN repo called "Dark mode" where we can discuss the implementation:
https://github.com/data-forge-notebook/editor-core
Cheers Ash
###################################################### Disclaimer: ###################################################### For the record, this will be my first open-source contribution
I couldn't be any happier than contributing to the DataForgeNotebook (DFN) project!
This is a "kick the bucket" event in my life.
A little brown-nosing but I think it's cool how Ash is bringing DataScience to the JavaScript community.
The JavaScript-DataScience community NEEDS DataForge Notebook!
AGAIN... I've never done this before, so I'm eager to get started.
###################################################### Quick STAR method map of feature implementation.. ######################################################
Situation: DFN currently doesn't have a Dark-and-Light-Mode-Theme (D&LMT) feature Task: Implement D&LMT feature into DFN with either existing or new CSS architecture Action:
###################################################### A few different possible solutions that come to mind... ###################################################### Context provider wrapper around the root component that passes state to sub-components to change styling when button toggled
TailwindCSS Dark Mode pseudo class i.e. dark:text-black-100 or classic classes i.e. .darkmode {color: black}, .lightmode{color: white} or SASS (it's my understanding that blueprintjs uses SASS for their component styling..) .block-element-modifier {color: $pt-dark-icon-color} https://blueprintjs.com/docs/#core/variables.dark-theme-styles or styled-components div(blueprintjs)
${props => props.dark && css
background: white; color: black;}
or###################################################### Blueprintjs Components & Styling ###################################################### Resource: https://blueprintjs.com/docs/#core/variables.dark-theme-styles
It looks as though Blueprintjs uses SASS styling to style their components
###################################################### Closing thoughts and feature discussion kickoff ######################################################
This is the beginning of what's to come! I'm excited to start. There are SO many ways to implement this. The floor is open to discussion. I'm an open-book. Officially submitting this issue!
Cheers, Josh
Design: Pluggable evaluation engine
Data-Forge Notebook is designed to evaluate code.
In DFN v1 code was evaluated in a separate Node.js process that was spun up by the main process. One evaluation engine was started per notebook the user has open in the editor, allowing multiple notebooks to be evaluated simultaneously. The main process and evaluation engine maintain bidirectional communication using node-ipc. Whenever the evaluation engine has output or results to report it would send them directly to the main process and they would be routed back to the particular notebook editor running the evaluation.
The evaluation engine should change in DFN v2. Under the hood it will basically do the same thing: assembly a JavaScript or TypeScript file from a notebook's data, run the code and the report the results back to the notebook editor for display to the user.
However in v2 I'd like to make the following changes:
Design: Platform specific entry points and editor-core library architecture
Data-Forge Notebook is designed to run on multiple platforms.
To support this the main body of code for the notebook editor is designed to be included as a library to be used in other projects that customize it to the needs of particular platforms.
For example DFN can be rendered in the browser or it can be rendered in Electron on various operating systems. So the way DFN handles "files" must be different in various circumstances.
This code repository is intended to be a code library to be included in other projects to create a full "build" of DFN. Other projects will create a DFN "shell" to house the notebook editor. The shell project will typically provide configuration and dependency injected services to customise the workings of the editor code.
The following "shell" projects are planned for the release of DFN v2:
At this stage though the editor-code is a project unto itself that has not yet been included in any shell project.
So the main question at the moment is how will editor-core be included in a shell project?
Here are some options on how that might be achieved:
Design: Pluggable visualizations
These are notes on "pluggable visualizations" (cell outputs) that will be added to DFN v2.
Work on this is in progress and partially complete.
Core plugins can be found under the
plugins
directory in the mono repo.display
function.file://
for the Electron build) or it can give it the plugin content directly (allowing plugins to be embedded directly in the Electron build).Long term
Prototype code
Backward compatibility
displayType
anddata
for each cell output still works. Although I'd like to to factordisplayType
out todisplayType
anddataType
. So data type could bearray
and display type could betable
.display.plot
must still work. Plugins should be able to register functions on thedisplay
method. This means that plugins need some kind of queryable API that's independent of he visualization. How will this be structured?Open questions
Todo