Giter Site home page Giter Site logo

ddt's People

Contributors

mrrio avatar nathggns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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

ddt's Issues

gulp-typescript-compiler isn't the best

We should look at replacing it. It seems to ignore a lot of errors that tsc reports, and can't generation '.d.ts' files which we will probably need to generate before rc.

Should we support dragging rows between tables?

Right now you can only reorder rows within a table. What if we were able to support dragging between different tables.

Some concerns with this

  • Different column sizes
  • Different amounts of columns
  • Styles

I'd say that we shouldn't hold back on releasing version 1 for this idea. It's just something to think about for the future.

I'll just leave this here so we can judge support for this feature.

Separate DDT into separate modules

DDT has lots of distinct parts that could probably be separated and then dependency injected.

The following identifiers can be moved into their own module

  • DDTPoint, DDTAxis
  • DDTCSS
  • DDTElement, DDTPositionableElement, DDTRow, DDTShadowRow, DDTTable, DDTShadowTable, DDTBounds
  • DragAndDropTable, DragAndDropTableOptions
  • toNumber (Util module?)

The current setbacks for this is that as we are using RequireJS as our TypeScript module output, there doesn't seem to be a nice way to concat all our modules into one module in one file. (We only want to export one module). If we don't concat, we run into issues were the user has to define paths for every internal module which isn't nice at all.

ACE editor seems to have gotten around this issue somehow but I'm not sure how.

UMD instead of AMD?

Issues with this is TypeScript doesn't technically support UMD. We'd have to write/find a tool to convert from AMD/commonjs to UMD.

DDTPoint minus and add affect both axis

DDTPoint has this really weird thing that by default arithmetic affects both axis - this is almost never what you want.

We should add a syntax that looks more like this

var point = new DDTPoint(5, 10);
var newPoint = point.add(DDTPoint.X, 5);

newPoint.x
// 10

newPoint.y
// 10

New event syntax

Currently we listen to events like this

table.emitter.on('ddt.order', function(order) {
    // order
});

This is the syntax that I think would work better

table.on('reorder', function(order) {
    // order
});

This would mean that DragAndDropTable would have to inherit from eventEmitter (which is fine, TypeScript should take care of that for us). We'd also have to drop the 'ddt.' prefix from our events, and rename the following events.

 - ddt.order => reorder

Automated Testing

We really need to add automated testing to this library before we can release the RC.

The issue we have is a lot of the code in this library can't be easily unit tested, as it is heavy UI code. There are a few classes that can be easily unit tested, which are the following

  • DDTPoint
  • DDTCSS

Parts of the following classes can easily be united tested, whereas others cannot

  • DDTElement
    • getNode
    • offsetTop
    • show
    • hide
    • calculateBounds (Maybe?)
    • getLeftPaddingAndBorder
    • getParentWithSelector
    • getVerticalBorders

This leaves the following classes and methods that cannot be easily unit tested and we will therefore have to find another way.

  • DDTElement
    • swap
    • clone
    • getUniqueStyles
    • cloneStyles
    • cloneUniqueStyles
    • cloneAttributes
    • getInheritedBackgroundColor
  • DDTPositionableElement
  • DDTTable
  • DDTShadowTable

The following classes do not need to be unit tested as they don't have any extra functionality (but can't be removed for various reasons)

  • DDTRow
  • DDTShadowRow

Add IE support

We want to add IE support at some point.

This is what support we have for IE at the moment

IE 11 and IE 10

Seems to be mostly working. Some issues with table borders disappearing but we should be okay. This will be the easiest to fix.

IE 9

Completely broken. Probably due to errors with the DDTCSS class not being properly supported in older browsers (due to using some new APIs for dynamically inserting selectors not existing).

Speed up by keeping an internal track of the value orders

Right now whenever you swap a row, the order array is recalculated (by selecting all rows and mapping over them).

This could become a bottleneck for large tables. We should look at keeping an internal array of the values and swapping the values when swapping rows.

Potential issues with this

  • If new rows are added we need to observe that
  • If rows are deleted, we need to observe that

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.