Comments (5)
Let me know if you'd like me to create a PR. I just wanted to get your take on it first.
from js_data.
interesting! thank you for the input.
I really like your idea of splitting this into two separate functions. That really makes it read better.
I guess my only hesitation about _.reduce
is the more complex API call.
Perhaps its work showing both methods?
start with the d3.nest()
approach then introduce _.reduce()
?
in both cases, i like your opinion to split the function out.
from js_data.
That's a fair point. If you want the code to be more instructive and easier to read, you can also be very explicit with the intermediate variables.
function trimObject(o) {
return Object.keys(o).reduce(function(result, key) {
var keyTrimmed = _.trim(key),
valTrimmed = _.trim(o[key]);
result[keyTrimmed] = valTrimmed;
return result;
}, {});
}
I'm using Object.keys
instead of d3.keys
because it's supported in ES5, so it's quite safe to use anywhere. I tend to prefer built-in methods where it makes sense.
from js_data.
In any case, since this is really just a suggestion, rather than an "issue", I'm going to close this item. The website you create is a really great educational tool. I'm happy to contribute if you need a hand. Cheers.
from js_data.
well, i think these are great ideas!
if you want to contribute this as an additional option - i'd love to add it.
On Wed, Nov 16, 2016 at 11:00 AM, Yony Kochinski [email protected]
wrote:
In any case, since this is really just a suggestion, rather than an
"issue", I'm going to close this item. The website you create is a really
great educational tool. I'm happy to contribute if you need a hand. Cheers.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#32 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAkmUOuA9H3kIPzITp3XSzPUPd9D9pAks5q-1LYgaJpZM4KyJ-y
.
from js_data.
Related Issues (16)
- add tools section HOT 4
- Update URLs everywhere HOT 5
- bocoup ads on footer HOT 1
- add 'about us' section HOT 1
- Add Spanish translation HOT 2
- switch en-US to just en
- fix up css
- Add is.js for validations in "Checking Data Assumptions" task HOT 10
- help for beginner on d3.csv display HOT 10
- add section for displaying output
- Code snippet text can overflow HOT 1
- Any plan to update this guide to use D3 v4? HOT 5
- Modify text to ensure language is generally familiar and understandable
- csv function behaves differently in d3 v5 HOT 5
- Upgrade to d3@6? HOT 1
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 js_data.