Comments (3)
I think this is a good idea, but unfortunately the types are distinct. Track
currently inherits from gosling.schema.Track
so it cannot be instantiated without arguments -- this is all autogenerated code that does validation. gos.Track
just inherits some additional "mixins" that allow method chaining for assiging properties to the underlying gosling.schema.Track
.
Another option would be to export a singleton of PartialTrack
for use in this situation:
# gosling/api.py
track = PartialTrack()
# example.py
bar_overview = bar_base.properties(
width=300, height=300,
alignment='overlay',
tracks=[
gos.track, # since overlay alignment is used with tracks, this is PartialTrack
gos.track.mark_brush().encode(x=gos.Channel(linkingId='detail-1')),
gos.track.mark_brush().encode(x=gos.Channel(linkingId='detail-2'))
]
)
With that said, there is likely a way to make Track
more "magical" and I'll take a look.
from gos.
Another option would be to have a gos.track()
util that inspects the arguments to decide whether to return a Track
vs PartialTrack
instance.
bar_overview = gos.track(data=data).properties(
width=300, height=300,
alignment='overlay',
tracks=[
gos.track(), # since overlay alignment is used with tracks, this is PartialTrack
gos.track().mark_brush().encode(x=gos.Channel(linkingId='detail-1')),
gos.track().mark_brush().encode(x=gos.Channel(linkingId='detail-2'))
]
)
The less magic the better IMO. And this is clearly a function that just adds some shorthand.
from gos.
Closing this for now since I think this is addressed by #19 (comment)
from gos.
Related Issues (20)
- Non-human genomic data HOT 3
- User guide on exporting plots HOT 3
- Examples of pile displacement HOT 2
- visibility_lt (or other visibility functions) will not accept "zoomLevel" as a "measure" argument HOT 2
- How to provide constant value for y? HOT 4
- Plotting Single Co-ordinate BED file on custom assembly HOT 3
- Using local data for heatmap HOT 7
- Loading data from URL isn't always a success HOT 3
- Blank canvas plotting local BED file HOT 4
- How can you check which version of gos is compatible with given version of gosling? HOT 4
- Scroll to zoom broken in VSCode
- Example gallery all empty HOT 1
- empty track HOT 3
- Migrate `gosling-widget` to an anywidget and include in repo
- pileup track empty
- potential CORs issue with local server? HOT 4
- race conditions with HTML renderer
- feat: (responsive) defaults (e.g. width, height) when not explicitly provided
- Extract data-server for gos/hg
- Support for Ibisdata HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gos.