from lightning import Lightning

from numpy import random, asarray, amin, concatenate, column_stack 
from seaborn import color_palette
from sklearn import datasets

"""
Explanation: <img style='float: left' src="http://lightning-viz.github.io/images/logo.png"> <br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3D scatter plots in <a href='http://lightning-viz.github.io/'><font color='#9175f0'>Lightning</font></a>
<hr> Setup
End of explanation
"""


lgn = Lightning(ipython=True, host='http://public.lightning-viz.org')

"""
Explanation: Connect to server
End of explanation
"""


n = 100
x = random.rand(n)*100
y = random.rand(n)*100
z = random.rand(n)*100

lgn.scatter3(x,y,z)

"""
Explanation: <hr> Random points with default styling
End of explanation
"""


n = 100
x = random.rand(n)*100
y = random.rand(n)*100
z = random.rand(n)*100
c = [240,117,145]

lgn.scatter3(x,y,z,size=4,color=c)

"""
Explanation: <hr> Random small red points
End of explanation
"""


n = 100
x = random.rand(n)*100
y = random.rand(n)*100
z = random.rand(n)*100
c = [asarray(color_palette('Blues', 100)[random.choice(range(100))])*255 for i in range(n)]
s = random.rand(n)*8+1

lgn.scatter3(x, y, z, color=c, size=s)

"""
Explanation: <hr> Random points with all styling options
End of explanation
"""


n = 500
x = random.rand(n)*255
y = random.rand(n)*255
z = random.rand(n)*255
c = column_stack((x,y,z))

lgn.scatter3(x,y,z,color=c, size=3)

"""
Explanation: <hr> Fun with colors
End of explanation
"""


