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

Add support for encoding TypedArrays as primitive objects for serialization #2911

Closed
wants to merge 11 commits into from

Commits on Aug 16, 2018

  1. Added support for encoding TypedArrays as primitive objects (represen…

    …tation objects)
    
    A TypedArray representation object has two properties: `dtype` and `data`.
    
    `dtype` is a string indicating the type of the typed array (`'int8'`, `'float32'`, `'uint16'`, etc.)
    
    `data` is a primitive JavaScript object that stores the typed array data. It can be one of:
     - Standard JavaScript Array
     - ArrayBuffer
     - DataView
     - A base64 encoded string
    
    The representation objects may stand in for TypedArrays in `data_type` properties and in properties with `arrayOk: true`.
    
    The representation object is stored in `data`/`layout`, while the converted TypedArray is stored in `_fullData`/`_fullLayout`
    jonmmease committed Aug 16, 2018
    Configuration menu
    Copy the full SHA
    636e644 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2018

  1. Addressed minor review comments

     - Use `Lib.isPlainObject`
     - Renamed `data` -> `value`
     - Added `Uint8ClampedArray`
     - Committed updated package-lock.json
    
    No changes yet to the logical structure of where conversion happens
    jonmmease committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    5030d3a View commit details
    Browse the repository at this point in the history
  2. JSLint

    jonmmease committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    dfd44d5 View commit details
    Browse the repository at this point in the history
  3. Move TypedArray convertion logic to a new Plotly.import method,

    Revert changes to coerce.js
    jonmmease committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    ec21714 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2018

  1. Configuration menu
    Copy the full SHA
    8de7b5a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5107c97 View commit details
    Browse the repository at this point in the history
  3. Add fallback for browsers that don't support TypedArrays

    In this case the decoded value is undefined, but an error won't be
    thrown.
    jonmmease committed Sep 10, 2018
    Configuration menu
    Copy the full SHA
    5cdb828 View commit details
    Browse the repository at this point in the history
  4. Convert encoded mock into test variable.

    This can't be a mock anymore because it is not valid as input to
    Plotly.plot without first passing through Plotly.decode
    jonmmease committed Sep 10, 2018
    Configuration menu
    Copy the full SHA
    1ec957a View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2018

  1. Configuration menu
    Copy the full SHA
    a7c3814 View commit details
    Browse the repository at this point in the history
  2. Remove circular dependency

    jonmmease committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    2b9bda9 View commit details
    Browse the repository at this point in the history
  3. Added new top-level Plotly.encode function.

    This function inputs a Plotly object and outputs a copy where all
    TypedArray instances have been replace with JSON serializable
    representation objects.  This function is the inverse of Plotly.decode
    jonmmease committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    669e8be View commit details
    Browse the repository at this point in the history