Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: d3-dataframe #15

Open
alexlenail opened this issue Oct 16, 2018 · 0 comments
Open

Proposal: d3-dataframe #15

alexlenail opened this issue Oct 16, 2018 · 0 comments
Labels

Comments

@alexlenail
Copy link
Owner

alexlenail commented Oct 16, 2018

D3 could come with a simple representation of matrix data.

Earlier sketch of roughly what this would look like:

matrix = {
		values: [[1, 2], [3, 4]], // sorted row-wise by default

    rows_iter:         function () { return this.values },
    columns_iter:      function () { return iterator_over_the_transpose_of(this.values) },
    flat_rows_iter:    function () { return iterator_over_flattened(this.values) },
    flat_columns_iter: function () { return iterator_over_the_flattened_transpose_of(this.values) },

    rows:              function () { return copy(this.values) },
    columns:           function () { return copy(transpose(this.values)) },
    flat_rows:         function () { return copy(flattened(this.values)) },
    flat_columns:      function () { return copy(flattened(transpose(this.values))) },

  	transpose: function() {
      return {
        values: transpose(this.values),

        rows_iter:         function () { return this.values },
        columns_iter:      function () { return iterator_over_the_transpose_of(this.values) },
        flat_rows_iter:    function () { return iterator_over_flattened(this.values) },
        flat_columns_iter: function () { return iterator_over_the_flattened_transpose_of(this.values) },

        rows:              function () { return copy(this.values) },
        columns:           function () { return copy(transpose(this.values)) },
        flat_rows:         function () { return copy(flattened(this.values)) },
        flat_columns:      function () { return copy(flattened(transpose(this.values))) },

      }
    },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant