JWAVE User Guide > JWAVE Server Development > Returning Graphical Data to the Client
  

Returning Graphical Data to the Client
The following example shows a simple JWAVE wrapper that calls the PV‑WAVE PLOT command to generate a 2D plot of the array received from the client. Graphics are automatically created on the server and sent back to the client for display.
 
note
The client developer uses the JWaveView class to request that the server return graphical data in addition to numerical data. Whenever JWaveView is used to execute a client request to the server, the server automatically creates a Viewable object. This object is then packaged and streamed back to the client where it can be displayed. If the client calls the wrapper with the JWaveExecute class, the graphics are discarded, and only the data are returned. For more information on JWaveView and graphics, see JWAVE Graphics.
Simple JWAVE wrapper that returns a 2D plot 
FUNCTION APLOT, client_data
; Unpack the parameters and data from the client. 
   arr =    GETPARAM(client_data, 'ARRAY', /Value)
   PLOT, arr
RETURN, 0
END
 
note
You must make sure that all coordinate system information is correct before you return a plot to the client. Also, note that the SURFACE and AXIS procedures create a temporary axis transformation that is not automatically saved by the PV‑WAVE session. To ensure that the correct transformation and coordinate system information is sent back to the client, use the Save keyword with these procedures. This causes the correct transformation information to be sent automatically to the client. For more information on coordinate transformations, see "Coordinate System Transformations".

Version 3.6
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.