statgen / locuszoom

A Javascript/d3 embeddable plugin for interactively visualizing statistical genetic data from customizable sources.
https://statgen.github.io/locuszoom/
MIT License
156 stars 29 forks source link

Helper function to rename fields anywhere in a layout #241

Closed abought closed 3 years ago

abought commented 3 years ago

Purpose

LocusZoom attempts to support many kinds of data, but in practice, no two usages have the same nomenclature.

This is very annoying when working with reusable layouts- modifying nested objects is not fun. This PR adds a simple helper method to make this process easier.

See unit tests for a full set of example use cases.

LocusZoom.Layouts.renameFields(layout, old_name, new_name, warn_transforms = true)

Tagging: @kbruskiewicz