Forum Discussion
How to visualize sleep segments?
- 2 years ago
There is a learning curve with everything, but I found it to be really short with Deneb. For your sample data the code is only this:
{ "data": {"name": "dataset"}, "mark": {"type": "bar"}, "encoding": { "x": { "field": "Date", "type": "nominal" }, "y": { "field": "Start", "type": "temporal" }, "y2": { "field": "End" } } }and the result is this
I assume you want to know which custom visual can help you create similar charts? I am pretty sure that Deneb can do that.
Not sure if I want to ask you for sample data - seems to be rather private information.
- Ivashamagnus2 years agoFrequent Visitor
I am very glad that you answered me! I was almost desperate to get an answer. It looks like I will be learning about Deneb's capabilities in the near future.
The data I collected for the graph.
Spoilerdate date date date The beginning of sleep The end of the dream sleep duration h\min total sleep h\min 30.10.2023 4:00 9:30 5,30 31.10.2023 1:00 6:00 5,00 01.11.2023 21:30 4:00 6,30 02.11.2023 1:00 8:00 7,00 03.11.2023 1:30 8:00 6,30 04.11.2023 4:30 12:00 7,30 05.11.2023 2:30 10:30 8,00 06.11.2023 23:30 7:20 7,50 07.11.2023 0:00 8:30 8,30 08.11.2023 4:00 10:00 6,00 09.11.2023 1:00 7:00 6,00 10.11.2023 23:50 9:30 9,40 11.11.2023 3:00 9:00 6,00 12.11.2023 23:40 8:20 8,40 13.11.2023 1:00 6:00 5,00 14.11.2023 0:30 9:30 9,00 15.11.2023 2:00 6:00 4,00 16.11.2023 22:30 6:20 7,50 17.11.2023 0:00 6:40 6,40 18.11.2023 22:30 6:50 8,20 19.11.2023 0:00 9:00 9,00 20.11.2023 2:30 9:00 6,30 21.11.2023 9:00 13:00 6,00 22.11.2023 2:40 10:40 8,00 23.11.2023 4:30 14:00 9,30 24.11.2023 1:30 10:30 9,00 25.11.2023 6:00 13:30 7,30 7,30 26.11.2023 6:00 12:00 6,00 6,00 27.11.2023 7:10 12:20 5,10 5,00 28.11.2023 5:00 9:00 4,00 4,00 29.11.2023 9:00 13:20 4,20 4,20 30.11.2023 7:00 13:30 6,30 6,30 01.12.2023 22:00 23:00 1,00 4,40 01.12.2023 9:30 13:10 3,40 02.12.2023 9:00 14:00 5,00 5,00 03.12.2023 8:00 14:30 6,30 6,30 04.12.2023 6:30 15:00 8,30 8,30 05.12.2023 0:00 0:00 0,00 0,00 06.12.2023 13:00 14:00 1,00 2,45 06.11.2023 21:45 23:30 1,45 07.12.2023 5:40 9:30 3,40 6,50 07.12.2023 17:50 21:00 3,10 08.12.2023 5:35 6:40 1,05 4,15 08.12.2023 12:00 15:10 3,10 09.12.2023 21:50 2:50 5,00 5,00 10.12.2023 22:00 23:40 1,40 7,20 10.12.2023 7:20 13:00 5,40 11.12.2023 7:10 13:20 6,10 6,10 12.12.2023 4:30 12:00 7,30 7,00 13.12.2023 6:30 12:00 5,30 7,30 13.12.2023 19:00 21:00 2,00 14.12.2023 7:00 15:00 8,00 8,00 I haven't looked at a lot of information about Deneb and I have a question. Do you know if there is an easy way, a ready-made solution to display sleep segments on a graph? For example, if we are talking about just different charts about the amount of sleep, steps per day, etc. then there is no problem in Power Bi that it would be easy to do. To implement in Deneb, do you need to use JSON codes, Python, or is everything not as difficult as if you had to study matplotlib in Python? I am not a programmer, and when faced with the task of visualizing my dream as in the example in the picture, I am faced with the fact that I cannot find a simple solution for this as for simple graphs. I thought that in Power Bi it could be done simply)
- lbendlin2 years agoSuper User
There is a learning curve with everything, but I found it to be really short with Deneb. For your sample data the code is only this:
{ "data": {"name": "dataset"}, "mark": {"type": "bar"}, "encoding": { "x": { "field": "Date", "type": "nominal" }, "y": { "field": "Start", "type": "temporal" }, "y2": { "field": "End" } } }and the result is this
- Ivashamagnus2 years agoFrequent Visitor
That's what I want, it's fantastic! It's like I've touched my dream after 2 months! I'll post the results of my creations here when I do it. I think you helped me a lot lbendlin, thank you!