Please create a minimum runnable example that shows your issue. I do not have all of your dependencies installed.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/cde304ad-a140-4c6e-a8cf-c5ed3f12cb97%40googlegroups.com.
Please create a minimum runnable example that shows your issue. I do not have all of your dependencies installed.
From: falex
Sent: Sunday, December 15, 2019 5:32 AM
To: Kivy users support
Subject: [kivy-users] Checkbox, dropdow-list errors and data is not scrollingon x-axis
I want to develop an android app which will be able to upload data, analyze and visualize it. After learning Python and kivy, I write a script which will able to upload analyze and visualize the data. It's time to finalize the app and do some designing using checkboxes and dropdown list. Previously, the code was uploading the data and also visualizing it successfully. But I was unable to perform multiple functions on a single code so for that I used checkboxes and dropdown-list options and from last month I am working on the script but unable to solve the errors on my own. The issues which I am having:
- checkboxes and drop-down list code error
- I want to present data in decent tabulated format
- the script is not supporting x-axis scrolling while it doing y axis scrolling.
I will be really thankful if this group will help me as my project deadline is coming very soon and I am struggling alot from last month due to the above mentioned errors. I am attaching the files kindly consider it.
Thankyou in advance.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
Please strip this down to a minimal kivy example.
I use a simple environment for helping with kivy. Limit your example to kivy and the standard library. I suspect you will need to also send a data file.
No Pandas, no Cufflink, No Ploty…
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/f2cdd8fa-289a-47c4-8146-808f19613b89%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/f2cdd8fa-289a-47c4-8146-808f19613b89%40googlegroups.com.
<CheckLabel@BoxLayout>: # *** Create a new class to display the data
check_label: 'Initial'
CheckBox:
size_hint_x: 1
Label:
id: cl_id
size_hint_x: 5
text: root.check_label
text_size: self.size
halign: 'left'
valign: 'middle'
<RV@RecycleView>:
viewclass: 'CheckLabel' # *** set the view class ***
scroll_type: ['bars','content']
bar_width: dp(15)
# do_scroll_x: True
RecycleBoxLayout:
default_size: None, dp(50)
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical'
def load(self, path, filename):
with open(os.path.join(path, filename[0])) as stream:
lines = stream.readlines()
self.dismiss_popup()
self.rv_data = [{'check_label': line} for line in lines] # *** change the data ***
In editor I also changed the background color using the canvas. The checkbox is hard to see on my machine with a black background.
Happy to answer any questions.
#script.py
def load(self, path, filename):
with open(os.path.join(path, filename[0])) as stream:
lines = [l for l in stream if not l.startswith('**')]
self.a=pd.read_csv(io.StringIO(''.join(lines)),dtype={'*A': str, 'B': int, 'C': str, 'D': str, 'E': str},sep='\t').rename(columns={'*A': 'A'})
self.pandaf1() #it will print complete data
self.dismiss_popup()
def func_1(self): #when user select checkbox1 this function will run
return self.a[self.a.C == "|"]
def pandaf1(self):
self.panda2rv(self.a)
def panda2rv(self, frame):
lines=[]
tl=frame.to_string().split("\n")
for i in range(len(tl)):
temp=str(tl[i])
lines.append({'text':temp})
self.rv_data = [{'func_1': line} for line in lines] #what should I change here to print func_1.
###.kv file###
<CheckLabel@BoxLayout>: # *** Create a new class to display the data check_label: 'Initial' CheckBox: size_hint_x: 1 Label: id: cl_id size_hint_x: 5
text: root.func_1 text_size: self.size halign: 'left'
valign: 'middle'...
I don’t understand what you are trying to achieve.
When you click the checkbox, you want the text on the label to change? Would it un-change if you unclicked it? Is this correct? Let me know and I can add it to the example.
Here is some info on the recycleview so you can better understand how it works.
<RV@RecycleView>:
viewclass: 'CheckLabel' # *** set the view class ***
…
The viewclass specifies the class for the item in the recycle list. The number of items created matches the number that are visible on the screen. Those viewclass items are recycled and have new data put on them, creating the illusion of a long list. The data comes from a list of dictionaries. The key from the dictionary is applied to provide data to the viewclass.
<CheckLabel@BoxLayout>: # *** Create a new class to display the data
check_label: 'Initial'
CheckBox:
size_hint_x: 1
Label:
id: cl_id
size_hint_x: 5
text: root.check_label
text_size: self.size
halign: 'left'
valign: 'middle'
The kv code creates a kivy object property check_label. I use this value to set the text value of the label in the CheckLabel instance. The dictioary in the recycle view data attribute, uses this attribute in the key of the dictionary to set the text on the label:
1. Check-boxes and drop-down list code error
2. Want to present data in decent tabulated format
3. the script is not supporting x-axis scrolling while it doing y axis scrolling.
On Sunday, 15 December 2019 17:55:01 UTC+5, Elliot Garbus wrote:
Please create a minimum runnable example that shows your issue. I do not have all of your dependencies installed.
From: falex
Sent: Sunday, December 15, 2019 5:32 AM
To: Kivy users support
Subject: [kivy-users] Checkbox, dropdow-list errors and data is not scrollingon x-axis
I want to develop an android app which will be able to upload data, analyze and visualize it. After learning Python and kivy, I write a script which will able to upload analyze and visualize the data. It's time to finalize the app and do some designing using checkboxes and dropdown list. Previously, the code was uploading the data and also visualizing it successfully. But I was unable to perform multiple functions on a single code so for that I used checkboxes and dropdown-list options and from last month I am working on the script but unable to solve the errors on my own. The issues which I am having:
1. checkboxes and drop-down list code error
2. I want to present data in decent tabulated format
3. the script is not supporting x-axis scrolling while it doing y axis scrolling.
I will be really thankful if this group will help me as my project deadline is coming very soon and I am struggling alot from last month due to the above mentioned errors. I am attaching the files kindly consider it.
Thankyou in advance.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/cde304ad-a140-4c6e-a8cf-c5ed3f12cb97%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/f2cdd8fa-289a-47c4-8146-808f19613b89%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/08c22e83-a8bd-4b47-ae9e-d8ad413dca59%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/08c22e83-a8bd-4b47-ae9e-d8ad413dca59%40googlegroups.com.
I’m still trying to understand how I can help:
Issues:
Do you want to be able to scroll in both the x and y direction in your recycleview?
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/ad13752c-2b6e-4b62-bdd4-9ed6064c2eed%40googlegroups.com.
Issues:
Do you want to be able to scroll in both the x and y direction in your recycleview?
>>Yes.
>>The code you have send is uploading & printing the text and at the start of each line there is a checkbox.
What I required: Let's say we have A-Z column in a table which have been uploaded by user, now the user is interested to see only F,H,I column data from the uploaded file. For this purpose we have created a function (func_a) which will print only F,H,I column data. When the user uploaded the file and checked the box (func_a) it will only print the data store in func_a rather than printing the huge file. In same way we create d/f functions for printing and visualizing the data.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/ad13752c-2b6e-4b62-bdd4-9ed6064c2eed%40googlegroups.com.
Got it.
str.
split
(sep=None, maxsplit=-1)
Return a list of the words in the string, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done (thus, the list will have at most maxsplit+1 elements). If maxsplit is not specified or -1, then there is no limit on the number of splits (all possible splits are made).
If sep is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, '1,,2'.split(',') returns ['1',
'',
'2']). The sep argument may consist of multiple characters (for example, '1<>2<>3'.split('<>') returns ['1',
'2',
'3']). Splitting an empty string with a specified separator returns [''].
If I have time later today, I will demonstrate these changes.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/7d2ce168-b32d-48fd-b7e3-a161cb4b9c2d%40googlegroups.com.
s = line.replace('\n','').split('\t') # remove returns and split into cols
I used the python string method replace to remove the new line from each line, and split was used to split the tab delimited column data into items in a list.
I created an index and stored it in the rv_data list. This was a quick way to get the index for the data in this row.
self.rv_data = [{'col_a': c[0],
'col_b': c[1],
'col_c': c[2],
'col_d': c[3],
'col_e': c[4],
'col_f': c[5],
'index': i} for i,c in enumerate(columns)]
Created the the list checked that stores the state of the checkboxes.
self.checked = [False for c in columns]
A ScreenManager is used to select the 3 columns of data to display:
CheckBox:
size_hint: None,None
size: (50,50)
active: app.root.checked[root.index] # state of the checkbox is stored in checked[]
on_active:
app.root.checked[root.index] = self.active
sm.current = 'a-c' if not self.active else 'd-f'
ScreenManager:
id: sm
transition: NoTransition()
ThreeColumns:
name:'a-c'
col_1: root.col_a
col_2: root.col_b
col_3: root.col_c
ThreeColumns:
name:'d-f'
col_1: root.col_d
col_2: root.col_e
col_3: root.col_f
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.