-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Tracker: User Feedback #577
Comments
I have one suggestion on documentation for
I'm not clear what that means. I think what's missing isn't what the keys should be, it's what the values for the keys should be. I've looked through the repo and sometimes there are functions, sometimes values. Sometimes the original values don't match the value in const MALE_COLOR = [0, 128, 255]
const FEMALE_COLOR = [255, 0, 128]
// later in the code...
const layer = new ScatterplotLayer({
id: 'scatter-plot',
data,
radiusScale: radius,
radiusMinPixels: 0.25,
getPosition: d => [d[0], d[1], 0],
getColor: d => d[2] === 1 ? maleColor : femaleColor,
getRadius: d => 1,
updateTriggers: {
getColor: {c1: maleColor, c2: femaleColor}
}
}); In the above case, the primary In other places, we have 2 different functions for new PlotLayer({
getPosition: (u, v) => {
const x = (u - 1 / 2) * Math.PI * 2;
const y = (v - 1 / 2) * Math.PI * 2;
return [x, y, equation(x, y)];
},
getColor: (x, y, z) => [40, z * 128 + 128, 160],
getXScale: getScale,
getYScale: getScale,
getZScale: getScale,
uCount: resolution,
vCount: resolution,
drawAxes: showAxis,
axesPadding: 0.25,
axesColor: [0, 0, 0, 128],
opacity: 1,
pickable: Boolean(this.props.onHover),
onHover: this.props.onHover,
updateTriggers: {
getPosition: equation
}
})
// where equation is:
const equation = (x, y) => {
return Math.sin(x * x + y * y) * x / Math.PI;
}; I have a work around for this so I'm not blocked, but I think this would be important for updated documentations. Thanks |
@jefffriesen Thanks for the feedback! I agree that we're not doing a good job explaining
Says that the output of
Let me know if this helps. If so, I will add a page to documentation on this topic. |
@Pessimistress Thanks so much for helping me out on this. Some of the explanation above makes sense to me, some not.
Perfectly clear and well designed
Yep, someone types in a new getColor: d => d[2] === 1 ? maleColor : femaleColor,` has a different result, even though
Where did c1 and c2 come from? Are they arbitrarily-named keys? They are not in the manhattan.json data structure (which is an array of arrays). Is there some meaning with the key names or could I just call them
It will only look 1 level deep even with nested data structures, even though in this example,
This statement is close to helping, but I can't reconcile it with the c1 and c2 object above. Hopefully going through and explaining this to me like I'm 5 will help out others when reading the documentation! Thanks again. |
@jefffriesen thanks a lot for asking for clarification. This will greatly help the quality of deckgl's documentation. Please send similar feedback here or create separate issues on github when you find more unclear docs! @Pessimistress your explanation is super clear. We should definitely put your explanation to our docs! |
@jefffriesen Think of |
@Pessimistress Oh, that clears things up. I forked the repo and was looking at the code, but I guess in retrospect I should have run the example and tried different things. I wonder if having that much flexibility in specifying update triggers is more confusing. When I was searching the code for examples, I saw several different ways of doing it. To me that was more confusing because I was trying to pick up on the pattern, whereas if it was consistent the pattern would be easier to spot. Is there a reason not to just have an array of values instead of objects with arbitrary keys? |
@jefffriesen you've probably already discovered this, but this is the updateTriggers diff implementation, and it supports a single value, an array of values, or a key-value map ( Thanks for the feedback! |
I plan to create issues for each item in the list and use our newly created workboard to track them. |
@shaojingli Sounds good but maybe we should go through the status first, these were created a while ago. |
A list of weaknesses in v4 docs and API based on questions and issues reported by our users. Can be addressed through API changes, better docs, FAQ articles etc.
V5/V6 API
V4 API
ONGOING
UNDER CONSIDERATION
updateTriggers
mechanism (e.g.Using Layers
See Changing colors of LineLayer #575, How to animate ArcLayer arcs individually? #633, Can't undestand how to update a layer position #643COORDINATE_SYSTEM
, Documentation for positionOrigin is wrong #599, cannot get accurate position using meter offset in scatterplot #677UNDER CONSIDERATION
Interactivity
(See How can I react to the user panning the map? #574)create-react-app
create-react-app: Identifier 'Buffer' has already been declared #624ALL REPOS
OTHER REPOS
OTHER
The text was updated successfully, but these errors were encountered: