Use the mouse to drag the block to one side. The Action button releases it. As you move the block, the cumulative work done on the spring is plotted as a vertical line at each x. If you move the block to the left compressing the spring or to the right stretching the spring, the amount of work done is the same. The work in both cases is positive because the dot product of force and displacement (f x) is positive when f and x are in the same direction. When the block moves back toward the neutral position work done on the spring is negative since the force and displacement are in opposite directions.