Revenue simulator

The pricing levers turned into sliders that recalculate revenue instantly.

Web and interface · JavaScript · Browsable demo

The problem

A pricing strategy is abstract until you watch it move. Explaining to a non-technical audience what happens if the price drops 10 % takes half a meeting; letting them drag the slider and watch the curve takes ten seconds.

What it does

  • Turns inventory, base price, occupancy, discount and demand into five controls.
  • Recalculates the revenue projection on every change, with no reload.
  • Draws the resulting curve live.
  • No framework, no build step and no dependencies: open the file and it runs.

What was decided while building it

The weekly curve is fixed, not random
The seven-day profile used to be random and redrawn on every move, so the curve jumped about on its own and the effect of the lever you were actually moving got lost in the noise. It is now seven fixed factors that add up to exactly seven, and a test holds it there.
The rate shown is the effective one
The panel used to print the base price while computing revenue per room from the discounted one: at twenty per cent off, the three figures sitting side by side did not agree with each other. All three now come from the same effective price.
An empty field does not fill the screen with errors
Clearing a number produced a non-numeric value that spread through every figure with nothing raising a warning: the panel filled up with dashes. The calculation now returns nothing on invalid input and the screen keeps the last valid figures.
No build step and no dependencies
The chart is drawn by hand on the browser canvas, with no library at all. You open the file and it runs, today and in five years: a sales demo that depends on an external library stops opening the day that library moves.

How far it goes

  • It is a calculator, not a model. Occupancy is a figure the viewer types in, not a response to price: lowering the rate does not raise occupancy here.
  • The seven-day projection is not a forecast: it is daily revenue spread over seven fixed factors.
  • There is no data from any hotel. The starting values are example literals and the whole calculation happens in the viewer's own browser.
  • The page is in English only: it was published that way in its repository and is embedded as-is, without retranslation.

Built with

  • HTML
  • CSS
  • JavaScript

Backs this service

Website and online shop design

Read the code · Open the demo