Coder Social home page Coder Social logo

react-spreadsheet's Introduction

react-spreadsheet

Spreadsheet as a reactJS component.

Install

Dependencies:

  • nodeJS 0.10
  • npm 1.4
  • grunt 0.4

How to install

    $ git clone https://github.com/carlosvillu/react-spreadsheet
    $ cd react-spreadsheet
    $ npm install
    $ grunt dev

Open your browser in http://localhost:3000

Description

The goal of this project is to build an online spreadsheet. It is a 40x40 grid with editable cells. Cells adapt to the data entered by the user.

When clicking a cell, the background of the cell turns blue, indicating it has been selected. Double click turns the background orange, indicating it can be edited.

Cell editing allows the user to enter numeric values or strings, as well as formulas. Formulas must have the following format: =(row number, column number) {op} (row number, column number)...

=A2+B8 this will add up the contents of the two respective cells

Editing ends when clicking any different cell. For formulas, the grid shows "Formula result".

Saving a file

The app saves files in csv format (comma-separated spreadsheet). To save a file click on the download icon (leftmost icon on the toolbar) and an alert will ask you to specify the name of the file. The default name was set as spreadsheet.csv.

Formulas, and not results, are saved in the csv file.

Loading

To load an existing csv file, simply drag a file onto the grid. The grid will show the exact number of rows and columns with the original data.

Architecture

The development is web-component oriented. Thus, the spreadhsheet is a single component that can be used in the following way, <Spreadsheet spreadsheetStore={spreadsheetStore} />. On the basis of this, it is very simple to create a multi-tab app with several spreadsheets, each with its own store.

I used ReactJS framework for this design, following Flux's development philosophy.

The main actors are

  • Store: saves the state of the full spreadsheet at any given point. If changes are made in the store, it emits a chain event to update the view.
  • View: consists of n row views, which, in turn, consist in m cell views.
  • Entity: there is a single basic entity: the cell. It contains its data and state and knows what to show, depending on its state (editing or non-editing).
  • Dispatcher: directs the information flow from the view to the store, so that the view never communicates directly with the store. This allows one to keep separate view events from data state-changes.

To do

Bitdeli Badge

react-spreadsheet's People

Contributors

bitdeli-chef avatar carlosvillu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-spreadsheet's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.