Git Product home page Git Product logo

d3-save-svg's Introduction

Eric L. Denovellis

About me

I am a computational research scientist in Dr. Loren Frank's lab at UCSF. My work focuses on developing scalable, interpretable algorithms and tools to decode, categorize and visualize neural representations. This work extends and applies marked point process switching state space models I developed during my postdoc with Dr. Uri T. Eden. I work closely with experimental collaborators to ensure these algorithms and tools are usable on large scale data.

I also build open source software packages for neural data analysis. These include:

  • replay_trajectory_classification a Python package for decoding spatial position represented by neural activity and categorizing the type of trajectory.
  • Spyglass is a data analysis framework that facilitates the storage, analysis, visualization, and sharing of neuroscience data to support reproducible research. It is designed to be interoperable with the NWB format (a data standard for neurophysiology) and integrates open-source tools such as SpikeInterface and DeepLabCut into a coherent framework.
  • spectral_connectivity is a Python software package that computes multitaper spectral estimates and frequency-domain brain connectivity measures such as coherence, spectral granger causality, and the phase lag index using the multitaper Fourier transform.

Previously, I completed my PhD in computational neuroscience at Boston University with Drs. Daniel H. Bullock and Earl K. Miller. There I developed computational tools and models to understand how prefrontal cortex supports the underlying neural computations necessary to switch between contexts. Specifically:

  • I showed how synchronous network oscillations in the prefrontal cortex provide a mechanism to flexibly coordinate context representations between groups of neurons during task switching
  • I used generalized additive models to show that anterior cingulate neurons can represent context, but do not play a significant role in switching between contexts
  • Finally, I developed a set of web-enabled interactive visualization tools designed to provide a multi-dimensional integrated view of electrophysiological datasets.

Contact Me: Email

d3-save-svg's People

Contributors

edeno avatar mbostock avatar shancarter 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  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

Watchers

 avatar  avatar  avatar  avatar  avatar

d3-save-svg's Issues

More comprehensive testing

Right now the tests are just to make sure save accepts SVG element and throws an error when the element is not an SVG. Probably should test the other components.

Suggestions for save method

Hi,
Thanks for the great work - it's been a awesome start to a problem I'm working on. I'm adding this issue as I didn't want to push these changes incase I've scr3ed-the-pooch but I noticed some interesting code in the save method and had a crack at updating it - please see below.

Changes

  • renamed input var config to avoid 'redefinition' in subsequent code
  • preprocess does not take a 2nd parameter
  • preprocess was called twice - removed 1st call
  • only call the getDefaultFileName method if required

Before

export function save(svgElement, config) {
  if (svgElement.nodeName !== 'svg' || svgElement.nodeType !== 1) {
    throw 'Need an svg element input';
  }

  var config = config || {};
  var svgInfo = preprocess(svgElement, config);
  var defaultFileName = getDefaultFileName(svgInfo);
  var filename = config.filename || defaultFileName;
  var svgInfo = preprocess(svgElement);
  download(svgInfo, filename);
}

After

function save(svgElement, pConfig) {
  if (!svgElement || svgElement.nodeName !== 'svg' || svgElement.nodeType !== 1)
    throw 'Need an svg element input';

  var config = pConfig || {};
  if (!config.hasOwnProperty("filename") || (config.filename || "").trim() == "")
    config["filename"] = getDefaultFileName(svgInfo);

  var svgInfo = preprocess(svgElement);
  download(svgInfo, config.filename);
}

Cheers

Figure out how to revert css style embedding after saving

Right now the code embeds external CSS as an element style. The problem is that after downloading, the style remains and can screw with interactive visualizations which change attributes, not styles.

Possible solutions are:

  • Copy the SVG to be downloaded into a new SVG element. Embed the CSS. Remove the SVG.
  • Remove the styles after downloading. Might be complicated and slow because need to traverse the element hierarchy and this already takes too long.

Speed up downloading

Most of the time is spent traversing the elements of the SVG and embedding the styles to make sure they are saved with the SVG. This is pretty slow. I wonder if you could embed the styles as a text data URI instead.

document how to contribute

I would have made a pull request, but I didn't have the time to figure out how the build process works, how I could test that things were working properly, etc. If you could put that in a CONTRIBUTING.md or directly in the README.md, it'd be a lot easier to help out :)

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.