GithubHelp home page GithubHelp logo

ap-sheet's People

Contributors

darth-cheney avatar dkrasner avatar eric-gade avatar

Watchers

 avatar  avatar

ap-sheet's Issues

dataFrame and view can get out of sync

Main issue

If you set the dataFrame size, (by setting corner for example), there is no guarantee that the cells in view will be inside the frame. Moreover, any resize or view updates will them throw errors effectively breaking the sheet. Size setting is common in situation where you are uploading data.

Here is a way to reproduce this in the resize example:
image

Frame validate geometry (origin, corner) not consistent

Main points

Due to how JS handles polymorphism and arithmetic with null/undefined values frame geometry check is inconsistent.

For example, this returns a frame:
new Frame([null, 4], [1, 20])
but this returns an error:
new Frame([1, 4], [null, 20])

We should either insist that points contain no null/undefined values or allow these frames to be created.

Sheet size / dataFrame needs to be responsive

Main Issue

Currently there is no flexibility of the size of the sheet. Once it fixed data has to fit into it. For example, if you upload a csv/xlsx data file with more rows or columns than in the current sheet it will error.

The only way around this is to first check on the number of col/rows set the sheet size appropriately (for which we don't have a UI) and then upload. This clearly is not what should happen and the sheet should adjust (which is why I labelled this issue a bug).

A related issue is #31

Frame, View Frame and Data Frame sizes

Main Issue

There are a number of issues dealing with views and sheets and the underlying data store. Some have been noted: issue #45 #29 #40 and #21 are examples.

The main crux is the following (I believe):

There is no guarantee that the DF is big enough. For example, I could start with a small sheet, example 5x5 (dataFram.size = Point([5,5])) and then increase the number of rows or columns in GridSheet (through resizing for example). This will cause all sorts of dataFrame.getAt errors for points which it does not contain.

You can try to fix this with something like this but other issues will still creep up.

For example, if you are at the bottom of a sheet (you scroll all the way to bottom) and then you enlarge resize you end up re-rendering (GridSheet.render()) to the top of the sheet and no columns or rows are added. Here you would expect that you either simply cannot resize bigger, or you end up with more rows/columns. But regardless you should not loose your view of the data, going back to [0, 0].

We can do the infinite grow options, or the google sheets "add rows/columns" context menu say.

In the end you should never get into a state where copy/paste, etc, fail b/c of "point not in frame" errors or "can't deal with undefined"

This might also be tied to the refactoring of dataFrame.store to be an async retrieval.

Selection relative frame corner is off by 1

image

You would expect the temp0.relativeFrame.corner = [2, 10], (not [2, 9]). temp0 = sheet.selection element

On a related note

image

The above selection is using the cursor position as the corner, which is correct, but visually the selection ends at [2, 8]

DataFrance Store does not update on cell edit

Main Issue

Cell editing does not update the sheet.dataFrame.store. For example:
image

the 3 console logs on the store you see are before I hit clear, after, and after I entered the "AAA" value into cell 0,0

resizeObserver bug

Main Points

setting sheet.setAttribute("expands", true) throws the error below no load:

image

Frame size is wrong

Frame(0, 100).size = Point(100, 100) where its actual size is 101x101

This happens due to the classic errors that arise when thinking about 0 indexed vs 1 indexed arrays

I think this should be handled together with #22

GridSheet should handle column and row tab labels

We should be able to reference columns and rows, and coordinates in general, using tab label. For example, GridSheet should methods like

.putAt(c, value, notify){
      pointOrCoord = this.getPointOrCoordFromRef(c);
      this.dataFrame(pointOrCoord, value, notify);
}

where c is either Point, [x, y], "x,y" or a label "ColtabRowtab like "A1" (== [0, 0] coordinate).

We could distinguish based on type and string structure.

At the moment this happens up in Worksheet which doesn't make sense and could lead to mismatch issues down the line.

NOTE: this can't work using DOM queries for tab element attributes, because we might be referencing elements which are not in view.

Similarly we need to think about the notion of column names at some point (or maybe not...)

Empty frames are sort of empty

Main Issue

Currently when an empty frame is made it's not actually empty. The returned frame is essentially the same as

f = new Frame([0,0], [0,0])
e = new Frame([0,0], [0,0]).constructor.newEmpty() 

They both have an origin and a corner. There is only the flag/attribute e.isEmpty which dictates that e is empty and f is not. Intuitively if a frame has an origin and a corner then the coordinates within that corner origin define points in the frame, and in practice when you see a frame with origin and corner [0,0] nothing tells you that you need to ask what kind of single point frame is this. This can lead to side-effects and errors.

We shouldn't need to call a frame empty, we should decide that it is empty b/c it doesn't contain any points. For example, we should allow Frame() or Frame(null) and Frame.isEmpty should be a (convenience) getter

get isEmpty(){
   if(!this.corner | !this.origin){
   return true;
   }
   return false;
}

dataFrame.getDataArrayForFrame() returns empty rows/columns

Main Points

There is a discrepancy between what you would expect sheet.dataFrame.getDataArrayForFrame(sheet.dataFrame) to return.

For example, create a sheet, clear it, add a few values. Then run sheet.dataFrame.getDataArrayForFrame(sheet.dataFrame) The store will look something like:

sheet.dataFrame.store
Object { "0,0": "a", "1,0": "b", "0,1": "d", "1,1": "d" }

but the output will be a 1000x1000 matrix consisting mostly of empty values.

I would expect it to return based on only the values in the store.

Also it might make sense to add a method like sheet.dataFrame.toArray() which mirrors the .loadFromArray() (instead of the above method where you have to pass a data frame to it).

Synthetic Clipboard can't handle empty values

Main points

If you try to copy a frame of the sheet where there are no values the SyntheticClipboard will throw a TypeError: value is undefined.

What it should do is populate the clipboard frame with empty value and paste those in.

Add `clear()` method to DataFrame

We need to add a clear() method to DataFrame that empties the store dictionary. The method should also call the stored callback method if there is one attached -- the GridSheet uses this callback to dispatch data-changed events on itself.

Allow for expanding based on rows

Proposal

Current the expands attribute listens to the parent element's width and expands the sheet's columns. It would be great if we had the flexibility to expand on columns, rows, and both.

Let expands take on columns | rows | both or columns | rows | all and update accordingly.

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.