In this blog entry I would like to discuss a bit about how to present user with a functional user interface when it comes about to showing a decision tree.
What is a decision tree?
Some of You probably have been buying a car. Or at least tried once or twice their on-line configurators. In such a configurator user is usually presented with a sequence of choices, like what color You like, what kind of engine and etc.
The questions are guiding user through the selection process one question after an another.
This is what I call a decision tree. I call it like that, because You can present it in a form of a graph which, in it’s most extreme case, will look like a full tree. Let me try to sketch it.
It is not a big tree, it shows just a few questions, so it can’t be big.
In fact it does not look like a tree at all. More like a bean pod or something. This is because the answers on three first questions are independent on each other. The color of a car does not have anything to do with a type of wheels. You can have low profile aluminum together with either black red or white. It does not matter, so the tree branches do collapse and join at the tree trunk.
However the third question opens a real piece of tree. After asking about the engine type we do ask about a battery size. Obviously all cars do have a battery, but the choice is very different. Electric car needs to have huge 10’000 amp hours or 50’000 amp hours (excuse me silly numbers, I just put them there randomly. I have no blind idea how large those batteries are). Gasoline needs smaller batteries so the choice is between 100Ah and 200Ah. Diesel needs a bit more so 200Ah and 300Ah.
Then the last question appears only on a diesel branch. Do You like to have a TDI? Yes or not? There is no point in even asking it for electric car or gasoline engine.
All right, so this is a decision tree. Now imagine You need to create a GUI for it. How will You do it?
Step-by-step, question after a question
This is a most common choice:
A plain dialog after a dialog, question after a question.
If You are nice then on each step You will show user a text area with an information about a previous choice.
For example like that:
This way You may guide Your user through a selection process, provide with images, help and explanations.
Of course You may also make it using some other form like tabs, enabled and disabled lists and etc. The key is that You are asking questions in a specific order. Once You reach the battery size question You simply select a right set. And You do not ask about TDI for anything but diesel.
When this is good idea?
Certainly when each question is used to direct user to do something. For an example if You do a digital camera support software You ask fist about what user likes to do, then what camera type he has and then are showing user how to connect it and at last what to download from it. There is no benefit in changing the order because You can’t download from a camera when it is not connected.
But with a car selector it is not a good choice.
When it is a bad idea?
Imagine a user who likes to select a car. Imagine, that this decision tree is a bit larger. Like, for an example, it has 20 questions or so. Once all questions are asked user is to be presented with a price and means to place an order.
All right, but what if user likes to check how much black car differs in price from a white. They can differ, right? But the question about a color was a first one asked!
Damn.
Your user needs to click back and re-do all the answers.
Of course You may remember them and suggest to user, but it is still 38 clicks away.
So maybe it will be much better to present it like that:
Tree as a dialog
I have again made some doodle. This is, as You can see, a dialog with some radio buttons. They can be radio button, check-boxes, drop downs and whatever. It doesn’t matter. The idea is that all choices are now visible. I even marked some selection with red dots.
The usual thinking about it is that user will make choices from top to bottom. The IFS EPDM team did that assumption. The LibreOffice team did. I recommend You to not make it. Instead assume that user can make any choice in any order and change it at any time.
For an example I might have first selected the battery size, then the engine type. This kind of dialog allows me to do that, right? This is the entire idea. I make a choice, dialog presents me with a price at a bottom. I like to try to make it black, so i check black and look at the price.
Nice, isn’t it?
Well… this also can be screwed up.
How to screw up that dialog.
Now imagine a user likes to try the electric engine. Like I draw on the left. But hey, electric engine can’t have 100Ah battery! This choice will be invalid!
What to do, oh what to do?
Blocking wrong choices
The first what comes to mind is to gray out invalid selections. In this case both diesel and electric will be grayed out due to battery. 10’000, 50’000 and 300Ah will be grayed out due to gasoline. And TDI, both answers, also.
And now imagine You are the user. And You try to figure out why the hell they are grayed out? In this simple example it is just a plain one-after another dependency. But the guys at LibreOffice in the “Image position” dialog are dealing with three levels deep dependency cascade. I needed a bug report, a long talk and half hour of trial and error to figure out how this dependency work.
So just blocking some choices may be frustrating to user.
What other choices do You have?
Correcting the user
In this approach You allow user to enter user a wrong choice but to not let prohibited selections You correct wrong ones to best, nearest selection. In this example when user selects “Electric” You test that 100Ah is a wrong selection and switch to closest equivalent. I have drawn it as a blue dot.
This way selection is fine and correct.
This is how IFS done it and how LibreOffice have done it. And I am mad on them, because I am loosing my time continuously due to that.
The tricky part is, that user may not notice that You made a correction. Especially when it happens far on the screen. This is not a big problem when a dialog is about You selecting a position of an image on a screen. But when instead of a nice, fashionable read car Your wife will get a black beast just because red was not good with some other distant selection You may get Yourself a not so nice divorce.
There is also an another problem with that approach. It is about non-reversible cycle.
When You make a correction You need to make a “nearest best choice” of some prohibited option. Now imagine I do click “Electric” and You select 10’000Ah because I selected smallest allowed battery size for “gasoline” so it is also best to select a smallest battery for “electric”. I am just looking on a price, so I am not even noticing it. I do then select a diesel, so you may choose from 200Ah and 300Ah. Again, logically, You do select a smallest one, that is 200Ah. Hmmph… it is still not a price I like. I like to try gasoline again and check an aluminum wheel. So I click “gasoline” and I frown. Why the price is 100 euros higher that the last time?
Obviously 200Ah is a valid choice for both “diesel” and “gasoline”, so there is no reason to correct it. But I have never ever clicked the 200Ah!
How to do it correctly?
I would be really happy if You would like to do it that way:
You will accept my selection. You will not change my wrong selections. Instead You will strike out or otherwise clearly mark it and all other invalid choices, gray out the “make an order” button and strike out a price with an explanation why it is wrong.
This way I can make I choice, see what is wrong and why, and then select what I like best. Surely this time if my wife gets a black car instead of fashionable red it is my true choice to make a divorce.
The Slic3r does something similar and I am happy with that.
That’s all for today.